Question

I have 100 comps that have 2 videos included within each. One of a videos shows a person doing something, the other video shows a person doing the same thing, but with a small detail changed.

I'd like to create a script that goes through the 100 comps and randomly enables one of the 2 video clips.

Any thoughts on where to begin? I know a little javascript. What's the function that can hide and show a video layer within a comp by name?

Was it helpful?

Solution

This should get you started.
Get the AE Scripting Guide over here

fun();
function fun(){
app.beginUndoGroup("XXX");// undo possiblilty
// prerequisites
// if there is no comp active return
var curComp = app.project.activeItem;
  if (!curComp || !(curComp instanceof CompItem)){
    alert("noComp");
    return;
  };

// loop all layers of comp 1 based Array
for(var i = 1; i < curComp.layers.length +1;i++){
  // check name
  if(curComp.layers[i].name =="foo"){
    // turn into opposite
    curComp.layers[i].enabled =  !curComp.layers[i].enabled;
    }
  }
app.endUndoGroup();
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top