Triggering Macro from a list based on matched string (Hotstrings)

Hi all,

As my endless quest for automation continues, I've found myself running out of memorable keyboard shortcuts, and so I've been seeing if it's possible to create a Hotstring macro in KM. The basic idea is that the macro would:

  • Be able to trigger other macros using a short alphanumeric sequence (or hotstring) in a safe environment where they wouldn't accidentally be triggered by normal typing
  • Display a list of all possible hotstrings and details of what they trigger (so i don't forget them)
  • Filter the list as i type to only show the remaining matches
  • Automatically trigger the associated macro when the typed string exactly matches the hotstring (so that partial matches don't trigger too soon)

After far too much messing around with entirely overcomplicated solutions, I have come up with this.

The format of the list items would be:

UUID__Hotstring - Details

The only thing that it is missing is the ability for the associated macro to trigger when the typed string exactly matches the hotstring. Granted, it only takes an extra half a second to hit enter, so this is by no means an essential feature - but it would be pretty cool...

Does anyone have thoughts on this - is it even possible?


As far as I know there's no way to do that. Nor is it likely that Peter would entertain the idea, because there're too many opportunities for unintended consequences.

Fair enough, just thought I'd see! Thanks very much!

Out of interest -- what are the advantages to this method compared with giving all those macros the same hotkey and using the Conflict Palette to filter them as you continue typing?

As in showing a conflict palette? Can you control that with your keyboard?

EDIT: just tried this, this is what I need! Thanks for bringing it up!

EDIT: actually thinking about it, the thing that's still missing is a safe place to enter the hotstring so that it won't be triggered in normal typing. I'd previously been using Alfred for this but it was clunky getting the two to talk to each other, maybe this will ease it though

@kayjaykay No idea if this could be something for you.

1 Like

Because you don't use a hotstring. Use a Hot Key trigger that's the same for all the macros you want to conflict, like ⌃⌥C. That brings up the Conflict Palette which will start to filter as you type in further letters. It's a different approach to using a different, fixed, typed string for each macro but it's a lot easier to set up and a lot less likely to have unintended consequences.

If you do want to use typed string triggers, take a look at @Frankb's post (he's keen on, and experienced with, typed string triggers), consider a hot key triggered macro that makes a new, sacrificial, TextEdit doc or similar to type into, or @ccstone's idea of an AppleScript prompt to swallow the string.

Also have a look at the Trigger Macro by Name action which, conveniently, shows the macro names and hot key combos without any extra work from you...

1 Like

That is very kind of you. But the only thing I am experienced in is asking questions in this forum. :joy:

And to be honest, I have given up my string trigger idea.... in favor of a new one. I call it "magic 4".

It's easy to create and expand. I can keep all my palettes, they always open in the right app and work like a shortcut/modifier. If I can't remember the tigger, I look it up in the palette or click the mouse, which always moves to the open palette and then back.

The function "4" remains if I only tap briefly (but is also a "modifier"). I reach the "4" key blindly with my left index finger. By simply swiping from 4 to 3 or from 4 to 5, to e, to r I blindly trigger more shortcuts and I'm sure I'll think of other things to do soon. :slightly_smiling_face:

I think the AppleScript dialog to swallow the string is what I'll end up going with, activating the hotstring macros at the same time and deactivating them once the dialog is gone. But thanks for your detailed answer!