I’m exploring the Photoshop API, specifically the require('photoshop').performMenuCommand() functionality. Through debugging, I’ve observed that menu actions trigger commands with numeric IDs (e.g., 101 for certain undo, 1170 for opening the Actions panel, etc.).
Could you kindly clarify whether these Command IDs remain consistent across:
Different devices (macOS/Windows), and
Different Photoshop versions?
This information would be invaluable for ensuring reliable integrations. Thank you for your time and support.
From what I know the ids remain the same and unchanged in the versions of photoshop.
The values that change are those with a negative value such as:
-20013.
Your clarification aligns with my observations—that plugin-related menu items (including built-in plugins like Blur filters) use negative Command IDs , while native Photoshop functions use positive ones. This insight is greatly appreciated!!!
I think this may be of interest but you still need to know the top-level ID number, if you wish to apply it for something other than plugins.
The top-level ID numbers are as follows.
Menu Item: &Help, ID: 1
Menu Item: &File, ID: 2
Menu Item: &Edit, ID: 3
Menu Item: &Layer, ID: 4
Menu Item: T&ype, ID: 23
Menu Item: &Select, ID: 7
Menu Item: Fil&ter, ID: 6
Menu Item: &View, ID: 9
Menu Item: Plugins, ID: 7200
Menu Item: &Window, ID: 8
This mostly works for me but I wish to be able, for example, to navigate to the Color Transfer option in the Neural Filters section but I cannot work out how to do that, let alone programmatically select options and run the filter.
Once I had I installed a plugin, then typically I would select the Plugins menu within the menu bar, I would then select from the dropdown list the item ‘MyPlugin Folder’ and within that I would find the item ‘MyPlugin’. If I click on ‘MyPlugin’ then the plugin will activate.
To do this programmatically, I would use the following lines of code in the context of the above referenced implementation.