How to get Photoshop menu item checked status?

Is there a way to get the checked status of a Photoshop menu?

For example, I would like to know if the user has the following menu item checked:

Adjustments Panel > Flyout Menu > Add Mask by Default

The commandID for that menu item is 1829.

I’ve tried using psCore.getMenuCommandState() but that only returns a simple true or false to indicate if the menu command can be invoked.

I’ve also tried querying all of the application properties to see if there was a preference property for the option, but unless I’m overlooking something, one does not exist.

If you find your menu item in menuBarInfo, you will se a checked param

image

const photoshop = require("photoshop");

const getMenuItem = () => {
    return photoshop.action.batchPlay([{
        "_obj": "get",
        "_target": [
            {"_property": "menuBarInfo"},
            {"_ref": "application", "_enum": "ordinal", "_value": "targetEnum"},
        ],
        "_options": {"dialogOptions": "dontDisplay"}
    }], {synchronousExecution: true})[0]["menuBarInfo"]["submenu"]
}

This looks promising, but that appears to only return menu data for Photoshop’s main menu bar (Help, File, Edit, Image, Layer, etc…).

The menu item I’m looking for is actually on the flyout menu of the Adjustments window (The menu that appears when you select Window > Adjustments and click the hamburger icon on the top right of the window).

Perhaps there is a similar way to retrieve that menu data?

As you can see in the screenshot, there’s a submenu in each of those items

For other plugin flyout menu access I believe you need manifest 5, but not sure if you will be able to access Photoshops own panel menu