Skip to main content
alexjr21
Participant
June 14, 2026
Question

How to copy and paste selections in UXP / Photoshop scripts

  • June 14, 2026
  • 2 replies
  • 37 views

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
June 16, 2026

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.

Chuck Uebele
Community Expert
Community Expert
June 15, 2026

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.