5 Replies Latest reply on Jun 23, 2015 6:06 AM by c.pfaffenbichler

    How to re-order layers within the same document?

    Mrc Dev

      Hi all,

       

      Started recently with photoshop scripting and ran into the following issue I can't seem to get the hang of.

       

      In my current script it takes the opened image and checks the folder it resides in for other images using the same naming prefix. So far so good, but when I start adding in the images into the current document as layers it will move the existing picture down the stack. My preference is to keep the original picture on top of the layer stack and move the new ones down the list.

       

      The best I could come up with is something like:

      app.activeDocument.artLayers.move(app.activeDocument.artLayers[2],ElementPlacement.PLACEAT END);

       

      If the above would work I could use it to have it loop over the other layers, but unfortunately it doesn't work. Please let me know if anyone has an idea of how to resolve this.

       

      Thanks!