UPDATED v1.2: If you run this macro when the Keyboard Maestro Editor is not the active application, you will be asked if you want to continue or not. Also, the TriggerValue prompt now includes the name of the macro, Thanks to @JMichaelTX for his suggestions and code examples,.
This is quickly becoming one of my favorite macros, and I just wrote it this morning!
Assign a hotkey to this macro.
Then when you're editing any macro, just tap the hotkey and the macro you're editing will run.
If your macro requires a %TriggerValue% parameter, then instead of tapping the hotkey, hold it down for half a second.
A prompt will pop up, asking you for the TriggerValue.
Click OK, and the macro is run with the TriggerValue.
###But wait, there's more!
The next time you tap the hotkey to run that macro, it remembers the TriggerValue you used before, and uses it again.
In fact, it can remember a different trigger value for each macro!
Want to change the TriggerValue or get rid of it altogether? Hold down the hotkey, and change the value in the prompt, or clear it out entirely.
All trigger values are stored as normal KM variables, so you can also clear them out via Preferences->Variables, if you want.
Why has this become my favorite macro?
I know it's really easy to assign a hotkey to whatever macro you're working on. But for some reason, the fact that this key is right there for any macro makes running the macro you're editing a snap.
And the added bonus of being able to supply a TriggerValue completes the joy of using it. Really!
Here's another benefit, and for me, probably the most compelling:
I don't have to remember to remove the test trigger when I'm finished.
I've been using F1, but I end up with a bunch of macros with that trigger that I don't want.
Also, it will be great for example macros uploaded to the forum. Again, I don't have to remember to remove the hotkey.
So, F1 will be assigned ONLY to your macro.
But Dan, my macro inbox is full. Can you please write a macro that will:
Working on #2. Soon. Plan on doing #3 - part of the reason I'm trying to get my macros on the forum is so I can point to them when I do videos. I'll leave #'s 1 and 4 to you.
Do you remember who it was that first mentioned the idea of holding down a hotkey versus tapping it? It’s such a marvelous idea, and I want to credit him, but I don’t remember who it was.
Just found a bug. Well, actually, not a bug. But a misleading error message:
What actually happened is that I tried to run a macro in a group that is only active when Quiver is the active app. Since the KM Editor was the active app, it wouldn't run the macro. But the error says "found no macros with a matching name".
I'm going to put in some checks to verify the macro and group are active.
Yeah, I already noticed that you have shamelessly stolen my patented long key press. Shame on you (At least you announced it beforehand ;-)
But now I’m stealing back from you. I’ve already started with your AppleScript for running a macro with ‘selectedMacros’. And that’s only the beginning…
Support running the last macro selected for editing when the active app is an app other than KM. I often need to test macros that require the active, frontmost app to be something else, like Evernote.
Provide an optional prompt showing the macro name and confirming the user wants to run it.
Have you tried it? It just asks the KM Editor for the currently-selected macro, and the KM Editor returns the selected macro regardless of whether the KM Editor is active (has to be running of course, but shouldn't have to be active).
Sounds reasonable. How would you imagine that would work? Holding down the key is for prompting for a parameter, so I wouldn't think that would be a good idea.
Yes, but evidently I was doing something wrong, like having the Macro Group disabled.
So, running with another app being active works.
I inserted these two Actions (in purple), but the Macro Name comes back as "Not Found"
What am I doing wrong? How do I get the name of the Macro to be run?
I don't see the need for any special UI. Just add the Actions and enable or disable however you like for the default. The user (as part of setup) can then change to suit his/her perf.
I'll post how I do it, and hopefully someone else can show me the one-step way of doing it, because I could never get it to work. And don't laugh at my convoluted solution - it works!