Q: Access to state of Menu: View > Shows > Grid


In short:
Is there data access available to state of state of Menu: View > Shows > Grid?

In details:
I’m trying to implement toggle action from device to change show/hide grid on document. In Photoshop UI, it is available Menu: View > Shows > Grid (ctrl+')
By localization issues, I’d like to avoid keyboard shortcut.

Menu command ID has verified by Alchemist plugin. But it is command for show or hide by the parameter. So I need to know the current state is showing or hidden.

Is there data available for reading somewhere?

I expect the answer will probably be the same as below.

1 Like

Hi @sttk3,

Thank you very much for the link. It seems working as expected.

Following is modified code to take commandID.
3504 is the grid show/hide.
It returns checked property from Photoshop UI.

async function myCommandState2(commandID) {
   var result;
   await require("photoshop").core.executeAsModal(async (executionControl, descriptor) => {
      result = await require('photoshop').action.batchPlay(
               _obj: 'uiInfo',
               _target: {
                 _ref: 'application',
                 _enum: 'ordinal',
                 _value: 'targetEnum',
               command: 'getCommandEnabled',
               commandID: commandID,
   return result[0].result;

ss_20240326_204512_Q_ Access to state of Menu_ View _ Shows _ Grid - Photoshop - Adobe Creative Clo

1 Like