This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | var expr = 'value + [0, Math.sin(time * 2) * 50]'; // example expression | |
| app.beginUndoGroup("Apply Expression"); | |
| var comp = app.project.activeItem; | |
| if (comp && comp instanceof CompItem) { | |
| for (var i = 0; i < comp.selectedLayers.length; i++) { | |
| var layer = comp.selectedLayers[i]; | |
| layer.property("Transform").property("Position").expression = expr; | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | //Find Top most Layer Index | |
| topStackIndex = function(){ | |
| for (i = 1; i <= thisComp.numLayers; i++){ | |
| if (i == index) continue; | |
| my_layer = thisComp.layer(i); | |
| if (! (my_layer.hasVideo && my_layer.active)) continue; | |
| if (time >= my_layer.inPoint && time < my_layer.outPoint){ | |
| try{ | |
| return my_layer.index; | |
| }catch(err1){ | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | //KeyAllanimProps.jsx | |
| // October 2013 Will Summers | |
| //willsummers.wordpress.com | |
| var proj = app.project | |
| app.beginUndoGroup("Keyframe all Animation Properties") | |
| if (proj) { | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | //Apply this expression to the Source Text property of a text layer at the top of a stack. | |
| //The for loop in here iterates down from the top to find the first layer that is active and gets its duration. | |
| nextActiveLayer = thisLayer; | |
| for (i = thisLayer.index + 1; i <= thisComp.numLayers; i++) { | |
| if (thisComp.layer(i).active) { | |
| nextActiveLayer = thisComp.layer(i); | |
| break; | |
| } | |
| } |