Skip to main content
alexjr21
Participant
Jun 14, 2026 7:33 PM UTC
Question

How to copy and paste selections in UXP / Photoshop scripts

Hi! I am trying to write a script in photoshop to repeatedly select, copy, and paste parts of the image. Through a few online resources (1, 2), I’ve managed to figure out how to write competent enough code in Visual Studio Code that will make a selection, but cannot figure out the javascript language to copy the selection and paste in a particular location on the image. Can anyone help? Thank you!

2 replies

Stephen Marsh
Community Expert
Community Expert
Jun 16, 2026 3:53 PM UTC

Does it need to be UXP?

 

If so, you have DOM and batchPlay code.

 

If legacy ExtendScript is OK, the same concept applies, DOM and Action Manager code.

 

So you have select and copy working? It might help to share your code, even if minimal and incomplete.

Translate
Chuck Uebele
Community Expert
Community Expert
Jun 15, 2026 12:37 PM UTC

Are your selections simple shapes? What are you trying to select? You can script selections in PS, but depending on what you want to select it could be more difficult.

Translate