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

**URL:** <https://forums.creativeclouddeveloper.com/t/q-access-to-state-of-menu-view-shows-grid/7703>\
**Category:** Photoshop\
**Created:** [March 27, 2024, 12:05am UTC](https://forums.creativeclouddeveloper.com/t/q-access-to-state-of-menu-view-shows-grid/7703 "2024-03-27T00:05:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![NaokiHada\_Logitech](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/naokihada_logitech/32/1543_2.png) [@NaokiHada\_Logitech](https://forums.creativeclouddeveloper.com/u/NaokiHada_Logitech)\
**Post date:** [March 27, 2024, 12:05am UTC](https://forums.creativeclouddeveloper.com/t/q-access-to-state-of-menu-view-shows-grid/7703/1 "2024-03-27T00:05:18Z")

</div>

Hi,

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?

 ![ss_20240326_165843_20240321_Flip_4.psd @ 66.7% (RGB_8#)](https://us1.discourse-cdn.com/flex015/uploads/xdplugins/original/2X/3/3fa2e022af0951615c719a65843f48f53ad65ad8.png)

 ![ss_20240326_170253_](https://us1.discourse-cdn.com/flex015/uploads/xdplugins/original/2X/5/542f112d7591d3428e88dc1da6a38191c98055a3.png)

---

<div class="post-metadata">

**Author:** ![sttk3](https://avatars.discourse-cdn.com/v4/letter/s/958977/32.png) [@sttk3](https://forums.creativeclouddeveloper.com/u/sttk3)\
**Post date:** [March 27, 2024, 3:08am UTC](https://forums.creativeclouddeveloper.com/t/q-access-to-state-of-menu-view-shows-grid/7703/2 "2024-03-27T03:08:44Z")

</div>

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

> [@How do you show/hide guides using uxp?](http://forums.creativeclouddeveloper.com/t/how-do-you-show-hide-guides-using-uxp/7572/9):
>
> It should theoretically be possible to check this with [getMenuCommandState](https://developer.adobe.com/photoshop/uxp/2022/ps_reference/media/photoshopcore/#getmenucommandstate). However, this method found by kbsanders seems more reliable. I actually tried it.

---

<div class="post-metadata">

**Author:** ![NaokiHada\_Logitech](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/naokihada_logitech/32/1543_2.png) [@NaokiHada\_Logitech](https://forums.creativeclouddeveloper.com/u/NaokiHada_Logitech)\
**Post date:** [March 27, 2024, 3:46am UTC](https://forums.creativeclouddeveloper.com/t/q-access-to-state-of-menu-view-shows-grid/7703/3 "2024-03-27T03:46:08Z")

</div>

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.

```auto
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](https://us1.discourse-cdn.com/flex015/uploads/xdplugins/original/2X/f/fb2d0c9b5d47856d362587be81e58d98e6a70b10.png)

---

<div class="post-metadata">

**Author:** ![Ganzi](https://avatars.discourse-cdn.com/v4/letter/g/e47c2d/32.png) [@Ganzi](https://forums.creativeclouddeveloper.com/u/Ganzi)\
**Post date:** [May 19, 2025, 2:23am UTC](https://forums.creativeclouddeveloper.com/t/q-access-to-state-of-menu-view-shows-grid/7703/4 "2025-05-19T02:23:36Z")

</div>

Hello, could you tell me how you got this batchPlay code? Or was it written by yourself based on your understanding?
