Can't get a comparison between a folder name and a string to work
dear community,
i have simple extendscript-example can't work , have no idea wrong. i'm trying write script goes through items in project panel , stores references folders names "layer1", "layer2", , on, in array. code should alert 3 times in case, doesn't alert once..
for (var i=1; i<=app.project.numitems; i++)
{
if ((app.project.item(i) instanceof folderitem) && (app.project.item(i).name == "layer"+i))
{
alert("found folder = " + app.project.item(i).name);
}
}
inside project in root-directory there 2 comps , 3 folders named 'layer1', 'layer2' , 'layer3' - should see 3 alerts when executing above script. testing-purposes changed second part of if-statement 'static' value so:
.. && (app.project.item(i).name == "layer1")) --> works! need dynamic solution..
thanks in advance!
greetings,
gilbert
it works me on cs6 windows. what's platform?
dan
More discussions in After Effects Scripting
adobe
Comments
Post a Comment