Photoshop scripting API getting me struggled. It’s not dev-friendly at all.
But still I believe, that there is a way to get layer object when I have layer id?
All I want to do is to duplicate selected layers to a new document. Layers might be nested within groups.
You’re right, such a simple action shouldn’t be so complicated.
Try this:
If it helps, Photshop ships with a reference(which should be in
PHOTOSHOP_INSTALL_FOLDER/Scripting/Documents) and/or the Object Model Viewer (visible under the Help menu in ExtendScriptToolkit).