Howdy folks. Ever since I got my Stream Deck I've been adding a lot of shortcuts on it for my most commonly used Keyboard Maestro actions. For instance, I have 10 or so buttons that import my most frequently used actions, and other buttons that trigger certain menu items, like Hide/Show Disabled Macro Groups, Sort Macros by Name, Group Selected Actions and so forth.
However, I am trying to figure out how to trigger the menu items "Enable/Disable Actions(s)". But I'm running into the issue that this particular menu item dynamically changes depending on how many actions are currently selected. If only one is selected, the menu item is titled "Disable Action", but if 2 are selected, it's titled "Disable 2 Actions". I would like to create a macro (that would then be assigned to a button on my Stream Deck) that will trigger that menu item regardless of its title.
I THINK I can do this using RegEX, but my RegEX knowledge is way too basic to know what string to use or if it's even possible. So can somebody either point me in the right direction with RegEX, or perhaps it's possible using an AppleScript to point to the menu item by it's hierarchal position?
I found this topic that indicates I can separate potential menu items by using the RegEX meta character for alternations "|" between them, and mentions that sometimes the caret "^" is also needed... but I can't get the macro to work using that method. Attached is a screenshot of the macro.
Or any other pointers are greatly appreciated. Thanks all!
EDIT: I seem to have gotten it working...I had an extra | at the end (I have up to Disable 10 Actions in the string) that for whatever reason prevented the macro from working. I removed it and now it does work, albeit a little slow. However, it only works when all selected actions have the same status, that is enabled or disabled. If I have a selection of some that are enabled along with others that are disabled it does not enable nor disable them even though in those instances the "Enable X Actions" menu item exists and is enabled.