-
Array help
Hi all,
I’m having a go writing my first script but I can’t seem to wrap my head around why this isn’t working. I have 12 items in my project folder and 12 items in this array. What I’d like is for the first item to duplicate by the first number of the array (duplicate 3 times), then the second item to duplicate by the number in the 2nd array etc.
What am I missing? any help much appreciated!
myArray = [3,2,5,3,6,9,7,6,5,7,5,6];
for(i=1; i<=app.project.numItems; i++){
var curComp = app.project.item(i);
var curDup = myArray[i];
for(d=1; d<=curDup; d++){
curComp.duplicate()
}
}