A document can contain layers a layer can contain other layers and groups then groups can contain groups… Im at work now but have posted function before on layer & group recursing…
do we have to worry about pathItems and Compound Paths, maybe even Symbols, or are they included in this?
Sorry I don't understand what it is you are trying to achieve… Most collections offer a getByName() method if you know what you are looking for eg…
doc.layers.getByName( 'fluff' );
This should return you the first found or error so you need to try & catch when using this…
that only returns top level layers. I basically need to find any layer that has a prefix of "export: " which is easy to match on top level layers, however when you get into layers that are nested as sublayers or compound paths and groups, it seems to make things a bit more complex. and this method does not work.
Layers can only exist in 2 places… 1 top level ( document ) or sub array of other layers and so on… Layers can not exist in groups or compounds… These are page items in the stacking order… So for layers you only need recurse doc and other sub layers…
Oooo! I never noticed this. silly me. for some reason it was in my head that you can have many sublayers in sublayers so is stacking order:
(maybe something I'm missing?)