"Typed String Triggers" – Please Help Make This "System" Better

I like "Typed String Triggers“. Eg to go to the KM forum I prefer to type "fkm" rather than use a shortcut. But this trigger type should only be used in text fields, because KM passes the typed characters to the front app and then deletes them, which can have unwanted side effects.

A safe environment for strings would be a prompt. But unfortunately this doesn't work, as _jims recently pointed out.

"This string is typed trigger does not fire within the GUI generated by Prompt With List. I've seen that same limitation with Prompt For User Input. I'm not sure about dialogs created with Custom HTML Prompt."

So what could you do? I tried Sticky Notes!

Here's what I came up with. All strings only work when typed in a very specific window of the app Sticky Notes (German, Notizzettel). The idea is to separate the typed string (trigger) from the app in which the macro is executed.

Example. The front app is my browser. ⌘+space opens this particular sticky window "KM/Sticky String Trigger".


Then I type "fkm". (KM deletes the characters afterwards and the cursor is always in the right place to enter a new string when this window is opened again). KM now switches back to the browser and performs the action "Open URL“.

Basically anything can be done this way, I think. Of course also normal text expansion. If the cursor is not in a text field by mistake (target app), nothing happens, because the text cannot be pasted.

Note: The longer the string, the more likely you need a pause before "Activate Last Application". Otherwise the characters will not be deleted correctly.

Here where I see the advantages of this "system":

  • Strings are more intuitive than shortcuts and you can see what you are typing. Shortcuts are also often already in use.

  • The system seems secure to me. The string triggers only work if Sticky is the front app and only in one specific Sticky window. In all other windows of any app nothing happens if the string is typed.

  • Because this particular sticky window is not the normal writing environment, it needs no or much less prefixes or suffixes around the actual string. So I don't have to type "=km=" if I mean "km".

  • It doesn't need "Enter" at the end of the string. Unlike "Trigger Macro by Name".

  • You can use as many letters as you want as a trigger. Unlike palettes that only allow one letter/character.

I still have one problem though. As I said, ⌘+space shows/hides the sticky window. How do I make it show only this window (KM/Sticky String trigger) and not other sticky windows as well? Unfortunately it does not work like this. Does anyone know how to do it?

Now I still need a smart system for the strings. I do not know yet what would be wise. I'm considering (at the beginning) to have a KM palette besides the sticky window as a reminder. Maybe something like this.

Unfortunately my KM knowledge is rather limited. I'm sure this can all be done much better. If anyone has ideas I would be very happy to hear them. Thanks! And I wish everyone a happy new year!

Hey Frank,

If I were serious about doing what you're talking about I'm thinking I would use a Custom HTML Prompt and build a system to call macros from a text box.

However – I don't have the skills to do that offhand, so it would take some real work.

On the other hand – within my current skillset I would probably build an AppleScript applet that opened a dialog to type in.

  • The applet would run all the time, so I could call it just like a regular application.
    • This would eliminate the problem of type-string-trigger bleed-through.

Another possibility is to use LaunchBar, Alfred, or a similar app to run Keyboard Maestro macros.

Several folks have done this over the years.



I remember a previous post by Michael where he asked 'why do this rather than use a palette'.

I found palettes very quickly 'feel' just like a typed string trigger really, if you use conflict palettes especially.

Hope you are well and Blwyddyn Newydd Dda Chris. Thanks for the imput here over the year.

For example on my main palette which works a conflict palette, if I type cmd + space + a + e I get Safari to open on my tech tabs.

It feels like typing a string and it works so fast that if you know the strings, which you need to do anyway for this suggestion by Frank, subsequent palettes aren't even noticed, I don't even see them sometimes I don't think. I will check.

Yeah, I get a flash of red on the screen that's all, I don't really notice it at all usually.

Just FYI,

I dropped LaunchBar for the second time, I do everything it does easily with Keyboard Maestro I have found.

I am not a power user of it though. I dropped it when it lost all my clipboard after a restart for the third time and I really needed something on it.

I went back to the Keyboard Maestro Clipboard-History which I find reliable and as good as any other.

1 Like

Thanks @ccstone as far as I understand typed strings do not work in a prompt.

Thanks @tudor_eynon Palettes are great, but not for this purpose. I want to see what I type.

I will experiment with it some more and then maybe report back :slightly_smiling_face:

They don't – nor did I suggest trying to use a user-prompt with typed-string-triggers...

I did mention the possibility of building a Custom-HTML-Prompt that includes a JavaScript EventListener – allowing you to build your own key sequence triggers – and probably display them as they were typed.

(This is fairly holy-grail level, and as I mentioned before I would not undertake it unless I really wanted the feature.)