Luckily for you, I made a macro to perform this exact function just earlier today, as I also had a similar setup in 7+ and earlier and quickly missed it upon upgrading to 8. There are surely other ways to do this (I saw one solution by the inimitable @ccstone that used GUI scripting) but so far this method is working well for me. (You will of course need to change the shortcut to one you prefer, but that should go without saying at this point )
Glad my rudimentary regex knowledge could help! I have a long way to go before I can stand alongside @ccstone, but thank you very much for the comparison
As I said, this has been working fine for me so far in limited testing, but if you (or anyone else who makes use of this) runs into any instances where it doesn’t work, please let me know so I can fix them.
You’re not alone in thinking of trying the new AppleScript functionality first! That’s exactly what I first looked into as well, but my AS knowledge is even more rudimentary than my regex and it was over my head to come up with a solution that way. Luckily the easy solution seems to be working okay so far
Yes I opened the Keyboard Maestro dictionary in Script Debugger and set to tinkering… but I think we’re at about the same level of AppleScript competency
I figured out how to identify the macro I’m editing, list its actions, and was working on identifying & counting just the selected actions (to search for Enable/Disable X Actions menu item) when I saw your solution.
@gglick Thanks for the macro! I didn't realize one can use this method to select a menu before. May I ask what the language of this? → ^(?:Enable|Disable) (?:\d+ )?(?:Macros?|Actions?|Macro Groups?). It look like regular expression but it uses space instead of \s.
@Alice_Shi You're welcome! This has been one of my own most useful macros when working in the KM Editor, so I'm glad it's proved useful to so many others.
To answer your question, it is a regular expression, just one that uses a typical space character. \s is handy for when you want to match any and all kinds of white space characters, but if you know you just need to match a typical space, there's no reason you can't use it in your expression.