Hi,
I'm trying to build an array of all the currently visible layers in a document, and the only way I know how to do it is by iterating (using for or do loop method) app.activeDocument.layers however, the problem is it is really slow for some reason. For 37 layers, it will sit there for about 10 to 15 seconds and the mouse cursor will fluctuate between normal and busy pointer.
A couple questions:
a) Is there a better way to build a list of visible layers?
b) Why is it taking so long to complete this (note: there is only one action within the loop which is assigning the current layer in the layers array to l):
var layers = app.activeDocument.layers;
for (var i=0; i<layers.length; i++)
{
var l = layers[i];
}
?
Any help on this matter will be much appreciated!
Thanks
Nate