Skip to main content
Inspiring
January 17, 2025
Answered

select document 1

  • January 17, 2025
  • 1 reply
  • 502 views

I always use many open documents
from 3 to 10 documents
I need a script that immediately selects the first one as in the figure.
I tried to make an action, but it takes into account the open documents,
so when I create the action that has 3 open documents and then I want to use it when I have 6, it doesn't work.

do you have any idea how to proceed

Correct answer Stephen Marsh
quoteI need a script that immediately selects the first one as in the figure.

 


By @Ciccillotto

 

Not sure about UXP .psjs, however, in legacy ExtendScript .jsx:

 

app.activeDocument = app.documents[0];

1 reply

Stephen Marsh
Community Expert
Stephen MarshCommunity ExpertCorrect answer
Community Expert
January 17, 2025
quoteI need a script that immediately selects the first one as in the figure.

 


By @Ciccillotto

 

Not sure about UXP .psjs, however, in legacy ExtendScript .jsx:

 

app.activeDocument = app.documents[0];
Inspiring
January 18, 2025

It worked fine in uxp Thanks for your help

Stephen Marsh
Community Expert
Community Expert
January 18, 2025

You're welcome, there is some crossover in ES vs. UXP DOM, but it's not my default expectation that things are 1:1 so I wasn't sure without checking.