Copy link to clipboard
Copied
Certainly there must be a simple way to move between adjacent tabs in Photoshop without having to click the tab with the cursor, right?
Sure use CTRL/CMD + ` (often called the tilde key: ~)
(upper left before the 1 key, adding SHIFT cycles back)
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) |
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, Dialog
...
Copy link to clipboard
Copied
Sure use CTRL/CMD + ` (often called the tilde key: ~)
(upper left before the 1 key, adding SHIFT cycles back)
Copy link to clipboard
Copied
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) |
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Fantastic! It took me some time to learn how to do the installation. Many thanks for providing the scripts and posting the link to the clear directions! Now I can easily navigate through my pages (I'm using this as a PDF editing tool).
Copy link to clipboard
Copied
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 🙂
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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
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:
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Wow. Thanks. Did you write this script specifically or maybe you found a ready one and modified it?
I wrote the script specifically on your previous comment, however, like most scripting projects, it's a combination of modifying existing code and adding new code to achieve the task.
But thank you very much for these scripts. They will definitely be useful to someone!
By @PeterSHarps
Perhaps they will be useful to someone if not you, I write scripts just as much for myself as for others, even if I have no use for the script itself. It's not about the destination, but the journey!
Copy link to clipboard
Copied
I've done it just changing the keyboard layout.
By default, my keyboard is Brazilian and I change to English ABC
Now, cmd + ` is working to change tabs in photoshop too
Copy link to clipboard
Copied
Still you are facing this probelm? Have you tried with ctrl+cmd
Copy link to clipboard
Copied
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.