Skip to content

Instantly share code, notes, and snippets.

@MarshySwamp
Last active April 15, 2022 16:52
Show Gist options
  • Save MarshySwamp/ffc74f9c4287224d35633808b9be24d5 to your computer and use it in GitHub Desktop.
Save MarshySwamp/ffc74f9c4287224d35633808b9be24d5 to your computer and use it in GitHub Desktop.
Code snippet: Run menu item - Collapse All Groups
/* An example of running a menu item command.
Use Script Listener to find the menu name, often by inserting the menu command into an action */
// Collapse all layer groups/sets
app.runMenuItem(stringIDToTypeID('collapseAllGroupsEvent'));
// another example:
// More info:
app.runMenuItem( charIDToTypeID("FtOn") ); // Fit on screen
/*
https://www.ps-scripts.com/viewtopic.php?f=66&t=7938&sid=2246506278ad480caef5ee21d819ada2&start=10
Courtesy of the late Mike Hale:
"FtOn"
"ActP"
"ZmIn"
"ZmOt"
If the string is not 4 chars then it is a stringID instead of a charID. Use stringIDToTypeID for those strings.
"screenModeFullScreen"
"screenModeStandard"
"screenModeFullScreenWithMenubar"
*/
// More codes here:
/* https://theiviaxx.github.io/photoshop-docs/CEP/event_codes.html */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment