Reading the documentation, this is what it says about moving layers…
- Arrange layers with
layer.move(targetLayer, Constants.ElementPlacement). AddedConstants.ElementPlacementfor moving layers:"placeAfter"(place below a layer, below group if group layer),"placeBefore"(place above a layer, above group if group layer), and"placeInside"(inside group layers only). - Send a layer to the back or bring a layer to the front with
layer.sendToBack()andlayer.bringToFront(). Iflayeris within a group, the commands will operate within that group.
The one I am interested in is moving a layer outside a group
I have tried various ways but cannot seem to get any to work
const layer = app.activeDocument.activeLayers[0]
layer.move(layer, constants.ElementPlacement.PLACEBEFORE)
Can anyone show me an example on how to do this please