Skip to main content
Participant
October 9, 2024
Question

Scripting in UXP Developer tools

  • October 9, 2024
  • 1 reply
  • 391 views

So I'm trying to create a plugin in Photoshop using UXP developer tools.

What I'm trying to achieve:

When i click "Play Action", i want the photoshop to play the commands "command + j" and then "option + [". Command j performs duplication of the active layer, option j performs selection of backward layer.

I can do it manually but it's tiring to work on multiple documents by doing it manually.

 

 

If it's possible,

I would rather want the script to do

Constantly check for active selection > if there is an active selection > perform the above mentioned commands.

 

Please check the attached document.

This topic has been closed for replies.

1 reply

Legend
October 9, 2024

Try recording it as an action and then saving the batchplay result.

Participant
October 10, 2024

Im sorry if this dumb, im using Ai to create this. the interface is greate but when executing the action, nothing happends. 

"

const photoshop = require('photoshop'); // Import the Photoshop module
const app = photoshop.app;"
is this correct? im using Photoshop Beta.  
and how do i write in the script to identify the active selection {marching ants) in the layer?