Sorting the layers and using a loop
Hello,
I have such part of code. It is sorting me the layers in proper order.
My question is how to use a loop of existence of every layer for that ? "Check if such given layer exists, use the code. When it doesn't exist, go to the next layer" ?
"
var aLay = app.activeDocument.layers.getByName("tertiary");
aLay.zOrder( ZOrderMethod.BRINGTOFRONT);
var aLay = app.activeDocument.layers.getByName("secondary");
aLay.zOrder( ZOrderMethod.BRINGTOFRONT);
var aLay = app.activeDocument.layers.getByName("primary");
aLay.zOrder( ZOrderMethod.BRINGTOFRONT);
"
