Skip to main content
Inspiring
Aug 20, 2025 12:15 PM UTC
Question

Reverse document order

You know when you've opened a number of images in Photoshop - but you realise they're in the wrong order and the one you want to look at first is right at the back.

 

// run a loop for all the open documents
for (var i = app.documents.length -1; i >=0;  i--)
{
  app.activeDocument = app.documents[i];
}

 

Just reverse the order!

You're welcome!

 

 

2 replies

Inspiring
Aug 20, 2025 2:17 PM UTC

Useful if you ever want to look at PDF pages in Photoshop - which is how it came to mind.

 

Translate
Stephen Marsh
Community Expert
Community Expert
Aug 20, 2025 12:44 PM UTC

@Ghoul Fool – thank you for sharing, I would have expected that one had to close the open docs and re-open in reverse!

Translate