Text Expansion: System & Hardware Info

Different strokes for different folks. The beauty is we can choose what ever we want with Keyboard Maestro

So I have a question for anyone who cares to comment. I have been using ";;" at the end of triggers. e.g. "km;;" expands to "Keyboard Maestro".

I note both @Tom and @JMichaelTX used ";" at the beginning of their trigger. What are the dangers of using either ";;" or ";" as part of the trigger, since some languages use semi-colons to separate values or end arguments?

Great thread everyone! How do I miss these? This one was way back on the calendar.

The thing with “;” at end is that the combination of letters followed by a “;” is very common in normal text, whereas the combination of a “;” followed by letters is not common (usually there is a space in-between).

But I don’t see why you shouldn’t use “;;” at the end of the abbreviation. I have quite some abbreviations with two Space characters at the end, which is similarly easy to type as “;;”.

Alternatively you can also surround the abbreviation with the special chars, for example “;er;”, if you would have conflicts otherwise.

1 Like

I have been using ";" at the beginning of all of my text expansion (TE) triggers for years now, in KM and other tools. So far, I've not had a false firing. As @Tom says, the semicolon is rarely, if ever, followed by non-white space character, at least in the English language.

My standard naming convention for text expansion is:
;<category abbreviation>.<text mnemonic><SPACE>

for example: ";km.as " -- insert an AppleScript code block in Keyboard Maestro

I find the semicolon very easy to type (as a touch typist), so this works well for me.
The semicolon works well to denote the start of a TE, and a SPACE works well to denote the end of a TE.

I have chosen good mnemonics for my <category abbreviation>, like:

  • km -- Keyboard Maestro
  • as -- AppleScript
  • js -- JavaScript
  • jxa -- JavaScript for Automation (JXA)
  • en -- Evernote
  • etc.

Use of a <category abbreviation> will allow you to quickly search for all TEs with that abbreviation when using tools like Typinator and Text Expander. Unfortunately, I don't know of a way to do this search in KM. Anyone?

The key, of course, is to choose characters that work well for you in the language you use, and that are intuitive to you. Some of this may be learned behavior, like using the semicolon. It is now a muscle memory for me. :wink:

2 Likes

@JMichaelTX - good system. Makes sense to me and is the most logical choice. More and more I am starting to use name.name or name.name.name conventions in Filemaker Pro as a way to organize layout, button, text object calls from scripts.

I wonder if there should be a Keyboard Maestro Standards page similar to http://filemakerstandards.org/display/cs/Overview or would that be overkill?

@Tom, I like the technique to perform different actions based on uppercase/lowercase letters in a triggering word. Must remember that.

2 Likes

Someone please, please, explain to me how to install this macro?

It is really quite easy:

  1. click on the link to download the macro to your Mac
  1. When the download completes, double-click on the file (.kmmacros) to import into your KM Editor app.
  2. The KM Editor should open to the Macro Group and Macro that was just imported.
  3. Review the Macro Triggers, and adjust as needed.
  4. When you are ready to use, make sure the macro is enabled.

Questions?

1 Like

The macro isn't working for me. Any suggestions?

Hey Abdallah,

Select the macro and then select:

Keyboard Maestro Editor ⇢ MenuBar ⇢ Help ⇢ Assistance

Go through the steps, and see if anything obvious pops out.

You need to make certain both the macro and the macro-group are enabled.

What version of macOS are you using?

-Chris

Oh, yeah.

You do realize that you need to type the given abbreviation(s) in a text editor of some kind – yes?

TextEdit, BBEdit, Mail, whatever....

-Chris

Yes, I tried it32%20PM in Text Edit

The macro is probably disabled, since installing a macro typically installs it disabled for safety.

@ccstone’s suggestion to use the Assistance window would confirm this.

Which is why I gave this instruction:

1 Like

LOLZ.

I'm pretty positive it has the check mark icon in the Macro.

Hey Abdallah,

You need to check with the macro selected – and check again with just the macro-group selected.

Both of them must be enabled.

And – they must be active in the context you're running the macro from.

-Chris

I just re-downloaded my original macro from the original post in this topic, and can confirm that it still works fine.

As others already have said:

  • Make sure the macro is enabled
  • Make sure the containing group is enabled (it comes in a group called “Text Expansions”)
  • There are three valid Typed String triggers that produce different results:
    • ;sysinfo
    • ;Sysinfo
    • ;sYsinfo
  • You have to type one of these strings in any app that receives text input, for example TextEdit, Mail, Notes, …
  • It might be necessary that “Keyboard Maestro Engine.app” has permissions in System Preferences > Security and Privacy > Privacy > Accessibility (but this concerns also other macros)
1 Like

I'll give everything mentioned here a try.

Thank you! The Macro group itself wasn't enabled. It now works fine!

1 Like

How do I get these expansions to work in TextExpander? I would like to use them with the TE Keyboard Maestro actions.