A script to turn off layers

All things .jsx

Moderator: Paul Tuersley

Post Reply
malex
Posts: 20
Joined: May 21st, 2004, 3:03 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;

}
}
}
tazkmdice
Posts: 1
Joined: January 31st, 2009, 1:48 pm

I am new to the world of expressions with AE. I have basically created a 14 layer animation in AE (CS3) and need a script to turn off the last 4 layers when I loop the animations. The only way I know to incorporate expressions is by adding it to the layer directly. How do you ad an expression to a composition? I have exported this out as an .swf so I can play it as a header for my web page. I only want a few layers to repeat the 2 time around and so on. Any help would be greatly appreciated. :oops:
Post Reply