Action if menu selection is greyed out?

i have created my first macro
in the macro it brings the application of the window i need
moves the mouse into position clicks the necessary highlighted menu action and then closes the window

the problem i have, as i dont know the state of toggle(set by the highlighted menu action carried out)
the menu action now being greyed out... no longer closes the menu upon selection
the macro basically ends being a step behind becos the final action being the close action is away from the menu

what kind of if/then action would i use... when a menu selection is greyed out??(no longer selectable)
i should clarify that when the menu is in view and the menu action is not greyed out... clicking on the menu action will cause the window to close upon selection
if the menu action is greyed out... the mouse clicks the position and carries on with the macro but that menu still remains becos the menu action has not been activated due to it being greyed out
thus the menu remains in view &the mouse click of the final action "close button" causes it to be a step behind
(apologies if this is not clear)
im wondering if there is any action i could use to anticipate that... as i dont always know what the toggled state of the greyed out action is
any help with this appreciated

Have a look at the KM wiki here; condition:Menu [Keyboard Maestro Wiki]

You need to use an If action with a Menu condition as described in the wiki. Your If can then act appropriately for when the menu item is enabled or not.

thank you, ill have a read

1 Like