script to change the out point of all layers in all comps

All things .jsx

Moderator: Paul Tuersley

Post Reply
vitaminman
Posts: 3
Joined: January 9th, 2005, 6:59 pm

Hey,

This script will go through all comps in a project and set the out point of all layers to 8 seconds. If you want to change the value of the out point to something other than 8, simply modify this line:

app.project.item(i).layer(j).outPoint = float value in seconds;


//script to set all layers in all comps to 8 seconds

totalItems = app.project.items.length; //grabs all project items and assigns them to totalItems
var layerCount = 0; // starts a counter to count all the layers in the project
for (i=1; i<= totalItems; i++) //first loop that runs through all the items and checks to see if they're comps
{
var myItem = app.project.item(i);
if (myItem instanceof(CompItem))
{
var totalLayers = app.project.item(i).layers.length;
for (j=1; j<=totalLayers; j++)
//second loop to go through each layer in a comp and set the out point to 8 seconds
{
app.project.item(i).layer(j).outPoint = 8.00;
layerCount++;
// increases the layer counter for each pass of the loop
}
}
}


alert("you changed the out point of " +layerCount+ " layers to 8 seconds");



Hope this is helpful to someone!


A big thanks to Dan Ebberts who helped me with a few problems over at the AE forums at http://www.creativecow.net.

Take care,

Nick
Post Reply