Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kingtosh/c37cfc7a1f205c21bcd11e67626cedb5 to your computer and use it in GitHub Desktop.
Save kingtosh/c37cfc7a1f205c21bcd11e67626cedb5 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