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.

 

Stephen Marsh
Community Expert
Community Expert
February 25, 2024
quote

Hi. Would you be able to create a script to switch between the last used tab and the current one? Today's browsers have something like this. If you have e.g.p. 30 tabs open and only use 2 at a given stage of the project, a keyboard shortcut to switch between the two tabs used would be VERY easy (just like in browsers such as Opera, Maxthon, etc.). This would make the task VERY easier, because in Photoshop you can only see a few TABS on the screen, to get to the others you have to open a drop-down list of all tabs. This makes it impossible to drag objects to a tab that is not visible at the top of the window because it is hidden on the left or right side. I hope I managed to describe clearly what I mean 🙂


By @PeterSHarps

 

 

Yes, this is possible. You could use a script to "mark" document A as a target and then "mark" document Z as the second target. Then a keyboard shortcut assigned to a script could open or cycle between both "marked" tabs, cycling between documents A and Z while skipping documents B to Y. I haven't used the feature that you mentioned in a web browser, so I don't have any frame of reference apart from your description.


@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:

 

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)