-
Find project.item – continue if found; if not, create.
for (var i=0 ; i<app.project.numItems.length; i ++) if (app.project.item(i). name != "stepOne") { // Not found -- I'll create it! var stepOne = myComp.layers.addSolid ([1,0,0],"stepOne",100,100,1); }else{ continue} // Found it, so I'll just keep going... var stepTwo= myComp.layers.addSolid ([0,1,0],"stepTwo",100,100,1); // Etc...Hi there,
I’m having a bit of trouble with what I imagine should be a fairly simple stage in a script.
I’d like to search for a particular project-item, create it if it doesn’t already exist, or else just continue if it does…
At the moment, the example script above is running through to the end without reporting any errors. However, it always just skips straight to “continue”, regardless of whether the subject of my search exists or not!
I’m sure I’m overlooking something simple – any ideas?
Cheers,
DP