TypeError: Cannot read property 'id' of undefined
at _directRef (uxp://uxp-internal:1)
at Layer.moveInside (uxp://uxp-internal:1)
at Layer.move (uxp://uxp-internal:1)
at createGroups (VM14 index.js:238)
at async _internalExecuteAsModalWrapper (C:\Program Files\Adobe\Adobe Photoshop 2022\Required\UXP/common.js:54)
at async _internalCallbackWrapper (C:\Program Files\Adobe\Adobe Photoshop 2022\Required\UXP/common.js:35)
This is using API v2 and the code is being run inside a modal scope
Edit:
I get the same problem when trying to move a normal layer inside a group layer. The only solution I can see at this stage is to move back to API v1 where .moveBelow() acts as moveInside().
Same here. I was really looking forward to this feature as a means to overcome usage of layer index for moving items. As such I would love to know if there is a work around for this (that doesn’t involve index computations). I hope this is getting some traction
My understanding is that you can use ID as a layer target in the ‘move’ batchPlay command, but that still requires you to specify the insertion point of the move as an index. Is that not the case?
Interesting! If you specify a layer by ID (under “to”), how does it know whether to insert after that layer (as sibling) vs. inserting inside (as a child of) that layer? In any case I’m gonna try that out…