Hello everyone,
I’m currently developing a plugin for Adobe Photoshop that includes a ‘Layer via Copy’ feature. So far, I’ve managed to make several paths and select them using the following script
core.executeAsModal(async () => {
const currentPathItem = app.activeDocument.pathItems[0];
currentPathItem.makeSelection(0.0, true);
});
This part of the script seems to work fine. It selects the first path item in the active document, creating a selection with a 0.0 feather radius and anti-aliasing enabled.
However, I’m encountering difficulties with the next step. In Photoshop, after making a selection, pressing Ctrl+J creates a new layer from the selected area. I’m looking for a way to automate this action using UXP scripting code.
I’ve come across several tips suggesting the use of batchPlay
, among other methods, but none have worked for me so far. I’m curious if there’s an alternative approach to achieve the Ctrl+J functionality within my script.
thank you!