A script to turn off layers
Posted: June 1st, 2004, 12:54 pm
This script will turn off numbered layers in selected comps. To make it work for you, select the comps in the Project Window, adapt the script below to turn off the layers you want (in this example layers 6 and 7 will be turned off), and then run the script. This is obviously interesting only if you have a large project with loads of comps and only specific layers have to be turned off.
//Created by J.C. Burns
for (i = 1; i <= app.project.numItems; ++i) { //for/next loop goes through all Items
var curItem = app.project.item(i);
if (curItem instanceof CompItem) { //test if current item is a composition
if (curItem.selected) { //test if the comp is selected
curItem.layer(6).enabled = false;
curItem.layer(7).enabled = false;
}
}
}
//Created by J.C. Burns
for (i = 1; i <= app.project.numItems; ++i) { //for/next loop goes through all Items
var curItem = app.project.item(i);
if (curItem instanceof CompItem) { //test if current item is a composition
if (curItem.selected) { //test if the comp is selected
curItem.layer(6).enabled = false;
curItem.layer(7).enabled = false;
}
}
}