document.layers.add() will add a new layer at the top;
.. If the Document has 5 layers in the sense,the newly added Layer should be the 6th Layer.
Please Give ideas.
Adding a layer to a set of five will automatically make this the 6th. I cannot see any other way.
l.move(LocationOptions.AT_END); //will move it at the bottom of the layers stack.
No.Actually the index of the new layer will be 0. so it will be first layer of the doc.
My requirement is that the index of the new layer should be index 5.
Or How to change the index of the Layers.
Thank you so much friend:-)
Actually i am new to this scripting.
ok.. i see what you mean. the index of the layer is related with the zOrder.
the topmost layer has the index 0 and the bottom layer has the largest index. also, layes.add() will add a new layer above the currently active layer.
to change the index you have to move the layer. see my previous post