Text-Expansion Macro That Gets Its Data From a Text File

Good afternoon everyone.

I would like to have the same set of text snippet to expand on the Mac and on Android.

On the latter, I can have a text expander with automagic, but I have to put abbreviations, or trigger, and text snippets on the same text file.

I could sync that file to the max and use it with KM but I wonder whether there would be a way to do that, since all examples I saw where single macros where the trigger was defined into the macro itself.

Any idea?

Thank you.

Ever figure it out? I’m looking to solve the same problem.

Perhaps separate files for each snippet is the right approach? As explained here What Do You Use for a Code Snippet Tool? - #27 by JMichaelTX

No, sorry, I gave up. Should you find any, please share, that would be interesting. Thank you.

Can you post an example of the abbreviations file. Nothing private. Just some abbreviations and triggers.

1 Like

Hey Hans,

This is simple.

You can use virtually any format you want that fits on a single line, and then you can parse the text returned by the prompt-with-list action as needed.

Here's one example:

Text-Expansions.txt.zip (934 Bytes)
Get Text-Expansions from a File v1.00.kmmacros (6.3 KB)

Macro-Image

Keyboard Maestro Export

This format relies on Keyboard Maestro's special double-underscore format for lists/variables where only the “label” on the right is displayed and the value on the left is returned.

chestnuts__nuts ⇢ chestnuts
Christopher Stone__cs ⇢ Christopher Stone
Keyboard Maestro Forum__kmf ⇢ Keyboard Maestro Forum

I've made the label also show the value, but you don't have to do that.


Can you do this without the prompt-with-list dialog? Yes.

-Chris