Create Text Expansions Macro

Here is a macro that lets you create simple text expansion macros. Simply fill in the text of the action with lines like:


where trigger is the Typed String trigger you want and text is the text you want to expand to.

Then select all the actions and click the Try button at the bottom to run them once and it will create a macro for each expansion. There is no trigger on the macro since its not going to be a macro you want to run except occasionally.

Note that to create a new expansion, just duplicate an existing expansion macro and adjust the name, trigger and text.

Create Text Expansions.kmmacros (5.8 KB)

Note, this macro does not XML encode the trigger or the text, so if the trigger or text may contain any characters that need XML encoding, then you need to either XML encode them when you enter them, or use the Filter action to XML encode them.


It would be great to be able to read all the TextExpander macros (over 1,000 on my system!) and convert them. That would be great. I guess I need to study KM more.

Hey Richard,

While Keyboard Maestro does a good job handling text-expansion macros, it does not provide as sophisticated a UI as TextExpander.

If you’re managing that many expansions I recommend you stick with TextExpander. I use Typinator myself and have 48,330 text-expansions and counting.

On the other hand you may find that Keyboard Maestro is more than adequate for your text-expansion needs.

Search the forum for “TextExpander”, and you’ll get 30+ hits. Amongst them are methods for extracting expansions from it. There is also some discussion covering when KM is a good replacement for a dedicated text-expansion utility.

Create some text-expansions in Keyboard Maestro and test them. Play with the differences between KM and TextExpander and then decide for yourself whether you still want to consolidate.



I have been testing this today. I really like KM’s text expanding ability. I think it will be a great replacement. Now with TextExpander going to a subscription service, KM is even a better match. I did not realize KM did text replacement like this. For me, this is great.

If I still get a for pay text expansion to supplement KM, I’ll look at aText. It’s only $5! But, why buy something else when I already have software that will do it. I have been using KM solely as a hot-key scripting engine. Now, There is more ways to use it. I really need to sit down and study this software better!

1 Like

I can highly recommend you Typinator. I’m using it for years and always found it to be superior to Textexpander (better features and search, faster). More pricey than aText, but if they are clever they’ll offer an discount now for TE switchers…

It’s from the same company that makes the very nice PopChar (and KeyCue).


I just moved all of my script based TextExpander items to KM. Works much faster and more reliably when the system is running full force (I do a lot of video editing). Now, to get my bad spelling helpers.

I’ve looked at Typinator, but I think KM fills the place okay. The UI is good enough for me!


The downside with Typinator is you can not export the expansions (unless that has changed in a recent version).

You can export them in its native format or as text.

1 Like

That’s great! It used to be able to only export its own .tyset format.

I was a big TextExpander user before I found KM. I now use both a lot.
But with TE moving to an expensive ($48/yr) subscription model, I won't be upgrading TE.

So, having used both TE and KM, IMO KM can be a great text expansion provider for many, many users. Of course, KM is much, much more than just a text expander tool!

But if you are more of a power user (like Chis, Tom, and myself (and others here), then you will probably find an app dedicated to text expansion useful.

Since both Chris and Tom think so highly of Typinator, I just took a look at it. With the 30% discount code of KC8L (expires Apr 8) that Peter provided earlier for KeyCue, I'm plan to buy the package deal, and save 33%

Turns out the discount applies to your entire order.

Looks like EUR 29.91 is about $US 34.08.

1 Like

That’s great (and surprising)!

Hopefully not too much OT, here are a couple of tips for TextExpander switchers (or Typinator beginners):

  • Install the predefined sets (in case they aren’t auto-installed). In the Predefined Sets sheet you also find a link, where you have even more useful sets and examples.

  • Set your Sets folder to a syncable location, for example iCloud Drive, DropBox:

  • Don’t forget to enable beta updates (they have a pretty good update frequency):

  • You can set the abbreviation prefix/suffix ‘globally’ for each abbreviation set:

  • Don’t miss out the regex abbreviation examples:

    Typinator uses the same regex package as Keyboard Maestro (ICU).

  • You can store snippets also in form of individual text files in the includes folder:

    Scripts also go there.

  • Your scripts can take an argument that you can feed through an expansion or via regex:

I hope this is useful.


Apparently the switchers are on the way now. From the latest change notes:

• Typinator now also supports import from TextExpander’s “textexpandersettings” file format.
• When importing from TextExpander, Typinator now correctly converts nested snippet invocations.

(It’s on 25% discount now.)

Coupon KC8L will get you 30% discount.

You said KC8L will expire 8 April. It seems the new discount is unrelated to KeyCue.

The KC8L coupon is still working as of now. Perhaps it will expire at midnight tonight, I don’t know. It is easy enough to try both coupons.

Hi guys,

I’m sorry if this is some sort of highjack. But I do not get this working (have KM only a few hours, not into scripting at all. Should learn that - any good tipps/ressources?).

I’ve got a “.hi”-Snippet expanding to


from datetime import datetime
import sys

currentHour =

if currentHour < 12:
sys.stdout.write(“Guten Morgen,”)
elif currentHour < 18:
sys.stdout.write(“Guten Tag,”)
sys.stdout.write(“Guten Abend,”)"

But I’m not sure how to switch that to KM. Can someone guide me on that?


Absolutely NOT a highjack. In fact, your post is very ON-topic, whereas mine and the other above were off-topic.

Yep, see:

If that does not answer your question, please feel free to post back in the above thread.

One suggestion: Instead of using the “Insert by Typing”, I would use the “Insert by Pasting” action at the bottom of the macro.

1 Like

Why’s that please?

One feature of TextExpander I saw mentioned is the ability to automatically capitalize the first letter of an expansion, if it occurs at the start of a sentence (but not capitalize if it occurs elsewhere). Is that possible with Keyboard Maestro?

Not really, no. You can configure your Typed String trigger to “case affects actions” in which case the Insert Text action will honour the case of the typed string (Lower case, Upper first or Upper all).

So for example, if you had a trigger of “hello” and an insertion of “hi there”, then it would map:

  • hello ➤ hi there
  • Hello ➤ Hi there

But that’s about as close as it gets.