Skip to main content
Participating Frequently
August 14, 2023
Answered

Keyboard shortcut for moving between tabs?

  • August 14, 2023
  • 5 replies
  • 13385 views

Certainly there must be a simple way to move between adjacent tabs in Photoshop without having to click the tab with the cursor, right?

Correct answer Stephen Marsh

You can install a script, then assign a custom keyboard shortcut to the script:

 

// Select Previous Doc
selectDoc(-1);

function selectDoc(theValue) {
	function s2t(s) {
		return app.stringIDToTypeID(s);
	}
	var descriptor = new ActionDescriptor();
	var reference = new ActionReference();
	reference.putOffset( s2t( "document" ), theValue );
	descriptor.putReference( s2t( "null" ), reference );
	descriptor.putInteger( s2t( "documentID" ), 862 );
	executeAction( s2t( "select" ), descriptor, DialogModes.NO );
}

 

Or:

 

// Select Next Doc
selectDoc(+1);

function selectDoc(theValue) {
	function s2t(s) {
		return app.stringIDToTypeID(s);
	}
	var descriptor = new ActionDescriptor();
	var reference = new ActionReference();
	reference.putOffset( s2t( "document" ), theValue );
	descriptor.putReference( s2t( "null" ), reference );
	descriptor.putInteger( s2t( "documentID" ), 862 );
	executeAction( s2t( "select" ), descriptor, DialogModes.NO );
}

 

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

5 replies

Participant
March 26, 2025

Ive tried Stephens script and it works good but is a bit slower than Control + Tab.
I like the speed ofControl + Tab but would just like to use a diferent keybortd shortcut for it. My question is why is this function not available to change shortcut combination for? This option is available for Illustrator under keyboard shortcuts so why is it not in photoshop...

Participant
March 26, 2025

Used the script Stephen posted in this thread and that works as fast as Control + Tab. THANK YOU!
Still the question remains why you cant just change this in keboard shortcuts. Am i just missing it?

Participant
April 25, 2024

For tabs that exceed the width of the screen, this has been such a work-flow bottleneck, super annoying. It should auto scroll or auto-reveal if you hold your mouse there for a few seconds. Even Ctrl+Tab while dragging would be a nice addition. Please fix this Adobe, some of us always have 20 tabs open.

Participant
February 25, 2024

Still you are facing this probelm? Have you tried with ctrl+cmd

John Waller
Community Expert
Community Expert
August 14, 2023

Ctrl+Tab works too (Mac/Win).

 

https://helpx.adobe.com/photoshop/using/default-keyboard-shortcuts.html

Result

Windows

macOS

Cycle through open documents

Control + Tab

Control + Tab

Switch to previous document

Shift + Control + Tab

Shift + Command + `(grave accent)

phidlerAuthor
Participating Frequently
August 14, 2023

Thanks, John and Stephen! I had looked at that chart and was so focused on the phrase "next tab" that I overlooked it.

I now find that pressing either cmd-Tab or ctrl-~ (I'm running MacOS 13.4) advance to the next open document, and adding the shift key moves to the previous one (i.e. the adjacent tab on the left, not necessarily the previously viewed one).

 

Followup question: is it possible to create a Keyboard Shortcut to assign a different key combination to this action? I don't see it in PS Keyboard Shortcuts and Menus (which doesn't appear to have a search feature), and MacOS System Preferences' Keyboard Shortcuts tool tells me "You cannot add keyboard shortcuts for the application Adobe Photoshop 2023." I'm not sure why that functionality would be disabled.

 

Participant
February 25, 2024

@PeterSHarps 

 

You can try the following 2 scripts. Note: as the scripts work by document name, it is expected that all open files have a unique name.

 

Script 1 of 2: 

Key Document Pair Bookmarker - Set.jsx

 

  1. Run the script to set the first key document.
  2. Select the second key document. Hold down the OPT/ALT key and run the script again to set the 2nd key document.

 

Script 2 of 2: 

Key Document Pair Bookmarker - Get.jsx

 

Run this script to toggle/cycle through the two key documents. You can assign a custom keyboard shortcut to this script once it has been installed in the application folder's Presets/Scripts folder and restart Photoshop if running.

 

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

 

/*
Key Document Pair Bookmarker - Set.jsx
Script 1 of 2
v1.0 - 25th February 2024, Stephen Marsh
https://community.adobe.com/t5/photoshop-ecosystem-discussions/keyboard-shortcut-for-moving-between-tabs/td-p/14005778
*/

#target photoshop

if (app.documents.length > 1) {
    // Hold down ALT/OPT key while executing the script to set the 2nd key document
    if (ScriptUI.environment.keyboardState.altKey) {
        setKeyDoc2();

    // Set the 1st key document
    } else {
        setKeyDoc1();
    }

} else {
    alert("At least two documents must be open!");
}


// Functions

function setKeyDoc1() {
    try {
        var os = $.os.toLowerCase().indexOf("mac") >= 0 ? "mac" : "windows";
        if (os === "mac") {
            prefFileOutLF = "Unix"; // Legacy = "Macintosh"
        } else {
            prefFileOutLF = "Windows";
        }
        var prefFileOut = new File('~/_Ps-Key-Document-Bookmark.pref');
        if (prefFileOut.exists)
            prefFileOut.remove();
        var setDoc1 = app.activeDocument.name;
        // r = read mode | w = write mode | a = append | e = edit
        prefFileOut.open("w");
        prefFileOut.encoding = "UTF-8";
        prefFileOut.lineFeed = prefFileOutLF;
        prefFileOut.writeln(setDoc1);
        prefFileOut.close();
        alert("1st key document set! Select the next key document and hold down the ALT/OPT key while running the script again to set the 2nd key document...");
    } catch (e) {
        alert("There was an error writing the '_Ps-Layer-Bookmark.pref' file!");
    }
}

function setKeyDoc2() {
    if (File('~/_Ps-Key-Document-Bookmark.pref').exists) {
        try {
            var os = $.os.toLowerCase().indexOf("mac") >= 0 ? "mac" : "windows";
            if (os === "mac") {
                prefFileOutLF = "Unix"; // Legacy = "Macintosh"
            } else {
                prefFileOutLF = "Windows";
            }
            var prefFileOut = new File('~/_Ps-Key-Document-Bookmark.pref');
            var setDoc2 = app.activeDocument.name;
            // r = read mode | w = write mode | a = append | e = edit
            prefFileOut.open("a");
            prefFileOut.encoding = "UTF-8";
            prefFileOut.lineFeed = prefFileOutLF;
            prefFileOut.writeln(setDoc2);
            prefFileOut.close();
            alert("2nd key document set!");

        } catch (e) {
            alert("There was an error writing the '_Ps-Layer-Bookmark.pref' file!");
        }
    } else {
        alert("First run the script without holding down the ALT/OPT key!");
    }
}

 

 

/*
Key Document Pair Bookmarker - Get.jsx
Script 2 of 2
v1.0 - 25th February 2024, Stephen Marsh
https://community.adobe.com/t5/photoshop-ecosystem-discussions/keyboard-shortcut-for-moving-between-tabs/td-p/14005778
*/

#target photoshop

if (app.documents.length > 1) {

    if (File('~/_Ps-Key-Document-Bookmark.pref').exists && File('~/_Ps-Key-Document-Bookmark.pref').length > 0) {

        var prefFileIn = File('~/_Ps-Key-Document-Bookmark.pref');
        prefFileIn.open('r');
        // Read the 1st line from the log file
        var getKeyDoc1 = prefFileIn.readln(1);
        // Read the 2nd line from the log file
        var getKeyDoc2 = prefFileIn.readln(2);
        prefFileIn.close();
        // Toggle between the key docs
        if (app.activeDocument.name == getKeyDoc1) {
            app.activeDocument = app.documents.getByName(getKeyDoc2);
        } else {
            app.activeDocument = app.documents.getByName(getKeyDoc1);
        }

    } else {
        alert("There was an unexpected issue reading the '_Ps-Key-Document-Bookmark.pref' file!");
    }

} else {
    alert("At least two documents must be open!");
}

 

A related script for bookmarking layers here:

 


Wow. Thanks. Did you write this script specifically or maybe you found a ready one and modified it?

I think that the easiest way would be to disconnect two tabs that are currently used more often (when using MockUps, you need 2 tabs to quickly preview changes) to disconnect them from the PS window and a second and third PS window will be automatically created and you can freely switch between them using a Windows Alt shortcut. +TAB. But thank you very much for these scripts. They will definitely be useful to someone! How convenient it is to switch between two tabs in a web browser (it speeds up work sometimes by 200%) can be experienced in the Opera browser, where in the shortcut settings the shortcut is called "Select a previously active tab". Once I got used to it, I later had to install plugins to configure shortcuts for Chrome and Maxthon to be able to quickly switch between tabs there as well. I often have over 100-150 tabs open and I often use specific ones at a given time (transferring content between them, comparing something, etc.) and this shortcut speeds up my work several times compared to searching for the right tab with the mouse cursor, which is sometimes 2 mm wide on the monitor with this number open cards.


Now the worst thing in PS that most disturbs my work is the width of the tabs, they don't fit and the need to use the tabs drop-down list. If you want to drag a given object or layer to another project and this one is on the drop-down list, this is not possible. It would be useful to have a script/way to change the default width of cards to a much smaller one.

Stephen Marsh
Community Expert
Community Expert
August 14, 2023

Sure use CTRL/CMD + ` (often called the tilde key: ~)

 

(upper left before the 1 key, adding SHIFT cycles back)