Update: After hours of trying different things to invalidate menuBarInfo
with no joy and finally digging through the internal UXP JavaScript for answers, I came across the following descriptor that does exactly what I need. It produces a real-time uncached status for a given menu item (commandID) including both the enabled
and checked
properties.
{
_obj: 'uiInfo',
_target: {
_ref: 'application',
_enum: 'ordinal',
_value: 'targetEnum',
},
command: 'getCommandEnabled',
commandID: <commandID>,
}
Executing this in a BatchPlay returns a result similar to the following:
{
"result": {
"commandID": 1002,
"enabled": true,
"checked": true
},
"command": "getCommandEnabled",
"dontRecord": true,
"forceNotify": true
}
I don’t know if this is an undocumented descriptor or how well it is supported.
If anyone has any further information, I would like to learn more about it.