Skip to main content
Participant
March 29, 2024
Open for Voting

make Photoshop select the next tab instead of the last document tab after we close the first tab

  • March 29, 2024
  • 2 replies
  • 306 views

I always edit things by order, and it's a bit making it slow if I need to open it from the first tabs from last tabs after I close the first one. Please make the setting of it, thank you

2 replies

Stephen Marsh
Community Expert
Community Expert
March 30, 2024

With files opened in standard sort order:

 

File1.psd

File2.psd

File3.psd

File4.psd

 

The first, far left tab is File1.psd and if this is the current active document, then the following script will close File 1.psd, then File2.psd will be the active document (not File4.psd). Running the script a second time will close File2.psd and File3.psd will be the active document. Running the script a third time will close File3.psd leaving File4.psd as the only active document.

 

I believe that this is what you are asking for as a native feature.

 

Once this script has been installed in the Presets/Scripts folder, it could be assigned the default keyboard shortcut of CTRL/CMD+W.

 

/*
Close Current Doc and Select the Next Doc Tab Sort Order.jsx
v1.0 - 30th March 2024, Stephen Marsh
https://community.adobe.com/t5/photoshop-ecosystem-ideas/make-photoshop-select-the-next-tab-instead-of-the-last-document-tab-after-we-close-the-first-tab/idc-p/14524157
*/

#target photoshop

if (app.activeDocument == app.documents[0]) {

    app.activeDocument.close(SaveOptions.PROMPTTOSAVECHANGES);

    if (app.documents.length >= 2) {
        var prevDoc = 0;
    } else {
        var prevDoc = app.documents.length - 1;
    }

    app.activeDocument = app.documents[prevDoc];

} else {
    alert("This script requires the far left document tab to be the active document!")
}

 

https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html

 

Stephen Marsh
Community Expert
Community Expert
March 30, 2024

@viviansungg 

 

As this is a feature request/idea, I can't comment on behalf of Adobe... But as a user, I can try to help with the use of current features.

 

If you open multiple files sorted in reverse order, (Z-A) i.e.:

 

File3.psd

File2.psd

File1.psd

 

File3.psd should be the first file open on the left tab, File2.psd in the middle tab and File1.psd on the far right tab and this would be the active document.

 

When closing File1.psd, File2.psd would then be the active document. Closing File2.psd would make File3.psd the active document.

 

Therefore, opening in reverse order seems the easiest way to work and not opening in regular A-Z order.

 

It should be possible to script your desired behaviour when using regular sort order, but that would take extra work when the answer is to simply open in reverse order.