Select Layers by name
Posted: June 9th, 2008, 5:05 am
I want to make a script that adjusts the levels of a layer with a specific name...
My plan was to do it this way, but it doesn't work, because "undefined is not an object" ??!
cheerz stakker
My plan was to do it this way, but it doesn't work, because "undefined is not an object" ??!
Code: Select all
numitems = app.project.numItems;
for(var i=1; i<=numitems; i++)
{
if(app.project.item(i).name == "left.psd")
{
var leftLayer = app.project.item(i);
theEffect = leftLayer.Effects.addProperty("ADBE Easy Levels");
theEffect.property("ADBE Easy Levels-0001").setValue(3);
theEffect.property("ADBE Easy Levels-0007").setValue(0);
}
else if(app.project.item(i).name == "right.psd")
{
var rightLayer = app.project.item(i);
theEffect = rightLayer.Effects.addProperty("ADBE Easy Levels");
theEffect.property("ADBE Easy Levels-0001").setValue(2);
theEffect.property("ADBE Easy Levels-0007").setValue(0);
}
}