A Bug? Trigger Ignores the "WORD BREAK"

A a 2-char string executes on a WORD BREAK as if it's on "any character" condition.
"ti" Expands to 2:56 PM (EXPECTED)
But it also expands "tile" or "mile" to 2:58 PM (UNEXPECTED)
So I can never type tile or tiger or time because they'll have my shortcut "ti"

[My expansion criterion is based on "Insert Text ”%ShortTime%" by Pasting"]
Any help to get out of this? Thanks!

Like with any text-conversion tool, the best move is to add some criterion that prevents the conversion from happening when the abbreviation/shortcut matches the text in a word. Some people do this with punctuation,



some do it with multiple spaces after the abbreviation

"ti "

some do it using letter combinations that aren't part of any word


The key is to use a system that is memorable and won't interfere with other words.

First, thank you for the generous care. It's certainly a disadvantage for KM. My PRD+ (a DOS era utility) and Textpander) and Phrase Express distinguish between the two and it's a shame that KM with so much power vested in it (!) , can't. Thank you again.

Again, avoiding existing words this can be achieved if Keyboard Maestro is set to activate based on proper text, like

" ti "

where there is a space on each side of the abbreviation. Of course, an actual word like it or if would still be a problem. But if the key is just a space after some letters like ti, it's hard to imagine how any utility would handle words like confetti or spaghetti in a sentence.

More than anything, though, using Keyboard Maestro for a large number (100s or more) of text expansions is not recommended (by the developer). The software has the capability, but it's designed to be an automation tool not a text-conversion tool.

Truly indebted for the time you have invested in educating me. Exactly! My main need (at least 80%) is text expansion and the rest launching apps and URLs. I'm going to toy around with Typinator too see if that's the panacea I'm looking for. Thanks for the solid lesson and hints.

Hey @Yu_Ii,

Sure you can – you just need to know how the triggers work – and that takes time and experience with the software.

@NaOH has explained about using prefixes and suffixes with your abbreviations.

Other text-expansion utilities generally do this for you to one degree or another, but part of Keyboard Maestro's power is that it lets you decide how you want to work.

This macro has β€˜tt’ as a trigger.

Except that it's not a literal string – it's a regular expression.

\b   == The beginning of a word.
tt   == A literal string.
[\s] == A class of characters containing any whitespace.

I could have used a bare \s, but I wanted to remind myself that I could add other characters to the class if I wanted.

So – now the expansion will expand on β€œtt[space, tab, return]”, but it won't expand on little or watt.

And – if the completion character is a return/linefeed that character is retained instead of eaten by the expansion.

Text-Expansion Macro β‡’ Type β€œthe test”.kmmacros (5.3 KB)

This is far more work than I normally want to put into a text-expansion, so I'll go back to Typinator now.

On the other hand – here's some very good examples of a text-expansion macros that take advantage of Keyboard Maestro's powers.

Text Expansion: System & Hardware Info

I'm not sure I'd call Typinator a panacea, but it's presently the best-of-breed text-expander utility available on the Mac in my opinion. (Most features for the money, good UI, very responsive developer.)



I moved all my text expansions to Typinator [which I bought immediately on a recommendation herein this forum].

The beauty and the strength of Typinator are in its simplicity. Ticking "Whole word" considers the shortcut a complete word and ignores it when it is part of a word or other strings.

For example:
good luck ➾ Good luck!
glade ➾ glade
rectagle ➾ rectangle

I'll keep using KM for launching URLs and apps or other higher calls if I can learn throught the KM protracted exampleless manual.

1 Like

Hey @Yu_Ii,

Yes, the KM manual is not especially inspiring – but there are many fantastic examples on the forum.

I have mailing list mode enabled in the Forum, so I can quickly peruse all posts for interesting tidbits.


I save what looks interesting and discard the rest.


Actually many KM Wiki articles have examples, so quite extensive.
There are some of the less-used features that do not have any Macros.
If you find any Wiki Articles that don't have examples, or for which you have questions, please feel free to post a new topic with your questions. Be sure to provide a link to the Wiki Article.

Note that every KM Action has a link to its corresponding Wiki article which you access by the "Help" item in the Gear popup menu on the top right of the Action.