Moving Solids
Hello,
I cannot figure out, to save my life, why this piece of code doesn't move all my solids into my "solids' folder.
I am testing using 4 solids in my project source, and it moves all but 1. They aren't the bottom files in my source and so the script def. loops through them. It also looks like the script skip every second file per the screenshot at the bottom of this post.
There is nothing corrupt with the loop. Alert tells me that X equals 4.
Does anyone have any ideas?
—
var i = 1;
var x= 0;
var solidos = app.project.items.addFolder("Solids");
while (i <= app.project.numItems) {
if(app.project.item(i).mainSource instanceof SolidSource){
app.project.item(i).parentFolder = solidos;
x++;
}
++i;
}
alert(x);
