Answers.Body: <p>I'd suggest animate the 'Opacity' property of the <em>outer glow</em>:</p>
  
  <p><a href="https://i.sstatic.net/ERB3i.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/ERB3i.jpg" alt="enter image description here"></a>
  <em>Click to enlarge</em></p>
  
  <ol>
  <li>Create a keyframe by clicking on the <em>stopwatch of outer glow</em> 'opacity' and set its value to <code>0%</code></li>
  <li>Create a second keyframe and set its value to <code>100%</code></li>
  <li><kbd>Alt</kbd><em>-Click</em> the stopwatch to create an expression and insert <code>loopOut(type = "pingpong")</code> to get an endless loop of <em>both</em> values</li>
  </ol>
  
  <p><a href="https://i.sstatic.net/pi9NM.gif" rel="nofollow noreferrer"><img src="https://i.sstatic.net/pi9NM.gif" alt="enter image description here"></a><br>
  <em>Composition length: 49 Frames, <br>
  2 Keyframes: frame <code>0</code> > opacity <code>0%</code>, frame <code>25</code> > opacity <code>100%</code></em></p>
  
  <p><strong>Note:</strong> In order to create a less generic animation, you can also create 3 or more keyframes by using <code>loopOut(type="cycle")</code> expression instead.</p>
  
  <hr>
  
  <p>To start the animation at a predefined time as well as stop the animation as you like, you can either <em>duplicate the layer twice</em> and <em>remove the layer styles of both duplicates</em> in order to concatenate all 3 layers by hand or write a <em>simple condition</em> like this:</p>
  
  <pre class="lang-js prettyprint-override"><code>// get the current frame of the composition
  currentFrame = timeToFrames(time, 1 / thisComp.frameDuration, false);
  
  // check if the current frame is in the predetermined range
  if (currentFrame &gt;= 20 &amp;&amp; currentFrame &lt;= 60) {
    // loop all keyframes
    loopOut(type = "cycle");
  }
  else{
    // if the current frame is not in predetermined range set glow opacity to 0
    thisLayer.layerStyle.outerGlow.opacity = 0;
  }
  </code></pre>
  
  <p><a href="https://i.sstatic.net/Sa4Lx.gif" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Sa4Lx.gif" alt="enter image description here"></a><br></p>
  
  <p><em>Composition length: 80 Frames, <br>
  Loop animation range: Frame 20 - 60, <br>
  3 Keyframes: frame <code>0</code> > opacity <code>0%</code> , frame <code>10</code> > opacity <code>100%</code>, frame <code>20</code>> opacity <code>0%</code></em></p>
  
  <p>Official <a href="https://helpx.adobe.com/after-effects/using/expression-language-reference.html" rel="nofollow noreferrer">expression language reference</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-07-23T04:01:38.583Z
Answers.Text: `timeToFrames(time, 1 / thisComp.frameDuration, false)` is the same as `time / thisComp.frameDuration` is it not? Simpler, and one fewer function call.
Answers.UserDisplayName: stib
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-07-24T11:16:25.870Z
Answers.Text: Yeah, good idea @stib. Feel free to edit my answer.
Answers.UserDisplayName: p2or
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-10-10T13:07:49.083Z
Answers.LastActivityDate: 2016-10-25T09:10:36.153Z
Answers.LastEditDate: 2016-10-25T09:10:36.153Z
Answers.UserDisplayName: p2or
Body: <p>I have a layer in After Effects to which I have applied an outer glow as a layer style. Ideally I would like the glow to turn off and on, in a loop, starting at a point in time and then stopping. Is this possible—perhaps with a script?</p>
  
Tags: <after-effects><after-effects-expressions><after-effects-scripting>
Title: How to loop outer glow layer style in After Effects?
UserDisplayName: Flobin
ThreadText: # How to loop outer glow layer style in After Effects?
  
  (Asked by: username_0 on 2016-10-09)
  
  I have a layer in After Effects to which I have applied an outer glow as a layer style. Ideally I would like the glow to turn off and on, in a loop, starting at a point in time and then stopping. Is this possible—perhaps with a script?
  
  **Tags:** after-effects, after-effects-expressions, after-effects-scripting
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-10-10. Score: 1 | Accepted answer
  
  I'd suggest animate the 'Opacity' property of the *outer glow*:
  
  [![enter image description here](https://i.sstatic.net/ERB3i.jpg)](https://i.sstatic.net/ERB3i.jpg)
  *Click to enlarge*
  
  1. Create a keyframe by clicking on the *stopwatch of outer glow* 'opacity' and set its value to `0%`
  2. Create a second keyframe and set its value to `100%`
  3. `Alt`*-Click* the stopwatch to create an expression and insert `loopOut(type = "pingpong")` to get an endless loop of *both* values
  
  [![enter image description here](https://i.sstatic.net/pi9NM.gif)](https://i.sstatic.net/pi9NM.gif)  
  *Composition length: 49 Frames,   
  2 Keyframes: frame `0` > opacity `0%`, frame `25` > opacity `100%`*
  
  **Note:** In order to create a less generic animation, you can also create 3 or more keyframes by using `loopOut(type="cycle")` expression instead.
  
  ---
  
  To start the animation at a predefined time as well as stop the animation as you like, you can either *duplicate the layer twice* and *remove the layer styles of both duplicates* in order to concatenate all 3 layers by hand or write a *simple condition* like this:
  
  ```js
  // get the current frame of the composition
  currentFrame = timeToFrames(time, 1 / thisComp.frameDuration, false);
  
  // check if the current frame is in the predetermined range
  if (currentFrame >= 20 && currentFrame <= 60) {
    // loop all keyframes
    loopOut(type = "cycle");
  }
  else{
    // if the current frame is not in predetermined range set glow opacity to 0
    thisLayer.layerStyle.outerGlow.opacity = 0;
  }
  
  ```
  
  [![enter image description here](https://i.sstatic.net/Sa4Lx.gif)](https://i.sstatic.net/Sa4Lx.gif)
  
  *Composition length: 80 Frames,   
  Loop animation range: Frame 20 - 60,   
  3 Keyframes: frame `0` > opacity `0%` , frame `10` > opacity `100%`, frame `20`> opacity `0%`*
  
  Official [expression language reference](https://helpx.adobe.com/after-effects/using/expression-language-reference.html)
  
  > **Comments:**
  > **username_2**: `timeToFrames(time, 1 / thisComp.frameDuration, false)` is the same as `time / thisComp.frameDuration` is it not? Simpler, and one fewer function call.  
  > **username_1**: Yeah, good idea @username_2. Feel free to edit my answer.  
  
  ---
  
  