I have a macro with a string trigger of ai set to match after a word break. But it always triggers after just those two letters and before a space or tab.
Is there something else I need to set that I've missed?
Correct. It matches after a word break. It does not require a word break to follow it. Otherwise it would have to know in advance whether the next key was going to be a word break or not and its not prescient. If it waits until you press another key, then there is another keystroke that needs to be remembered, undone, and then redone, and it is impossible to do that without race conditions and possible negative consequences.
So it will match if you type “aim” but it will not match if you type “main”.
You will need to adjust your trigger, perhaps include a trailing character.
Yes, as described the problem with waiting until you type space, tab, comma, full stop, etc after the trigger is you now have to deal with that character, and there is no way to deal with it that works in all cases due to the nature of the queueing system for events.
And as a general rule, if I can’t do something reliably in Keyboard Maestro then I usually wont do it at all.
Hey, just stumbled upon this thread, had the exact same problem (or better: Misunderstanding )
My actual goal was to have “hotstrings” that are triggered whenever I finish the hotstring “word”, in whatever way. E.g. by a space, pressing the return key, entering a period or comma…
Is there a way to achieve that goal?
I have now entered a space character behind all my hotstrings, but (of course) now they are triggered only, if I hit space after entering the string.
There is a utility called “Spark”, which is able to do that. I don’t want to use it, though, because the hotstrings defined there don’t work in all curcumstances. E.g. text input fields in browsers are not served by Spark, as it seems. Keyboard Maestro ist more reliable in that regard.
Not exactly an issue, but it would be nice to stay in my habit to just use a hotstring as any other word, simply ended by space OR by comma OR by return... But if it's not possible with KM, I'll have no big problems to change my habits.
My hotstrings (the term "hotstring" comes from a utility that I used back when I neded to use Windows at work. Don't recall its name, but it called those string triggers or string replacements "hotstrings") are usually very short. "vg" for "Viele GrĂĽĂźe (=best regards) etc.
most of them don't appear inside a word usually. However, even if they did, that should not be a problem, if they are treated as words, i.e. only trigger the replacement, if they are ended like any other word, i.e. by space OR comma OR period OR return... (actually any non-alphanumeric character).