-
for loop to remove all layers in a comp.
Hi guys, some help will be appreciated! This one should be very simple.
Im writing a very simple for loop to go over a comp to remove all layers.
for(var i = 1; i <= app.project.item(1).layers.length; i++){
app.project.item(1).layer(i).remove();
};
The problem I am having is that for some reason, it only removed layer 1, 3 and 5 leaving inside the comp layers 2 and 4…. it is the first time I use the .remove() inside a for loop, could you please let me know what am I doing wrong? the same for loop works fine with any other tasks I tried such as hide all visible layers, etc. Its only with the remove(), not sure if its a bug or something i am doing wrong…
Thanks!
Fabio