Keyboard Maestro provides over a dozen ways to trigger a macro (automation). One of my favorites is the string trigger option, because it actually enables you to trigger an action as you type, without having to lift your fingers to type a keyboard shortcut.
A string trigger consists of typing two or more keyboard letters assigned to a macro. It’s sort of like using an automatic word expansion program, such as TextExpander. Typically after a string of letters are type, Keyboard Maestro will quickly delete the letters and then run the assigned macro.
Here’s an example: I often need to sleep Dragon Dictate as I type. I could certainly stop and use the assigned keyboard shortcut to sleep Dragon Dictate, but that would mean lifting my fingers off the keyboard. So instead, I sleep or awaken Dragon Dictate by simply typing my assigned trigger, “ddg”. Keyboard Maestro triggers the keyboard shortcut for me, and I keep on typing.
The action takes place in about a second. String triggers can be used globally, or assigned to only work within a specified application.
Creating String Triggers
Assigning a string is as easy as assigning a hotkey trigger or application trigger. But you do need to be careful about the letters you use. It’s important the the letter combination is not a part of regular word; that is, unless you intend it to be.
The best type of stringer triggers are the ones that are easy to type without lifting your fingers, and are sort of abbreviations for the action they are triggering. If it helps, you can create triggers that must match a case, like “Ddg”
To make the string trigger easier to remember, you might combine two words for the action that it triggers. For example, to paste the title of a webpage in Safari, I can type, “stitle,” which in mind means “Safari Title”. Or you might have the string trigger only activate after you type the letters, followed by a word space.
The following are some sample string triggers I use. The string of letters I assign work for me, but you will naturally want to choose letter combinations that you can remember and are easier for you type.
Paste Current URL: paste in the URL of the frontmost Safari page. This can also work in any application.
Next Track in Rdio: this macro is mapped to a special BetterTouchTool action that activates an assigned menu item in the assigned application. So as I’m typing, I can type, “rnx,” and the macro will trigger the action in BTT, which in turn will activate the next track menu in the Rdio player. This is all done in the background. No switching between applications. I use a similar trigger for iTunes.
Convert to Title Case: this trigger will select a line of text and convert the first letters of each word, without me having to lift a finger. Because the title is pasted to a special named clipboard in Keyboard Maestro, I use another trigger to paste that title wherever I need it.
Send Mail: this macro will send an email. So when I’m finished typing usually a short letter, I simply type “sendm” to send it off, again without lifting my fingers off the keyboard.
Delete Last Word: this macro selects the last word I type and deletes it, saving me the trouble of hitting the Delete key.
Automation Made Easy
If you’re really into Mac automation, you should have a lot of fun with string triggers. If used effectively, they should save you from remembering keyboard shortcuts and lifting your fingers off the keyboard. They’re just as powerful as using TextExpander actions.
Let me know what you think of string triggers and how you use them in your automation workflow.