Too Many Triggers
After posting one of my macros for Keyboard Maestro @hiilppp tweeted that there is a simpler way: Create a service with one line of Shell script. That is simple, but I have more services than I care to admit. So I started to play around with various methods of triggering scripts and macros. I am not a savant with LaunchBar, TextExpander or Keyboard Maestro, so there may be better solutions that what I describe. If so, comments are open.
Services
Services are great in Lion (and Snow Leopard). Automator makes the process of creating text services very easy. Once the service is installed, it can easily be mapped to a keyboard shortcut. That means to some degree a large amount of snippet handling can be done natively with the default OS. In reality, TextExpander is much easier to use and greatly simplifies snippet management and syncing.
The problem with shortcuts for macros, is that after awhile there are just too many to remember. Personally I can only remember about a dozen snippet triggers and keyboard shortcuts. I really only remember the macros I use a lot. Everything else just wastes time if I have to lookup the shortcut.
LaunchBar
I’m squarely in theLaunchBar camp. I use it constantly. One of the reasons for that, is there’s very little to remember. I simply start typing what I want and LaunchBar figures the rest out. It is very forgiving too. Often, I can misspell what I am looking for and it will still show up in the list of options. That’s not the case with a keyboard shortcut.
LaunchBar has the ability to trigger any installed service. That’s pretty awesome. Unfortunately, the behavior is a little less than ideal. LaunchBar behave very much like a separate helper application than it does a system service. If text needs to be sent to a service by LaunchBar, it must first be loaded into LaunchBar. That measn the workflow is a bit awkward and requires using Instant Send followed by selecting the service and then pasting the result back to the text document. That still doesn’t feel right.
AppleScripts in LaunchBar are even less flexible than triggering services. It’s still a lot of fiddling. There is definately power to weild but it’s not what I’m looking for.
TextExpander
TE is a great application. Look no further than Brett’s site to see some of the amazing things it can do. It is not, however, a macro launcher. While the snippets can contain scripts, they can not be triggered by hot keys. There is a way to make it feel like a Quicksilver replacement[1] but it has never been satisfying to me. I use TE daily, but I use it for a very specific purpose. I use it for text expansion.
Keyboard Maestro
You knew this was coming. I’ve become a huge Keyboard Maestro nerd. Remember that feeling you had when you first discovered the Mac and wanted to go around shaking everyone trying to open their eyes to something better. To some degree, every great application feels a little like that. Quicksilver, TextExpander and Dropbox all felt like a revelation that needed to be shared with everyone. KM feels very similar.
KM provides a perfect solution to the “too many triggers” problem. If the same keyboard shortcut is assigned to multiple KM macros, a pop-up pallette is displayed to select a specific macro. It’s not obvious, but the items in the list can be selected by using the keyboard too (fn + number). In this way, a great many macros can be triggered from just a couple of keyboard shortcuts.
For example, I have mapped most of my macros for manipulating selected text to the control-space hot key. I can select some text and in an instant get a list of all my macros for tweaking text. I can select the exact macro I want by hitting the fn+number key that corresponds to its position in the pallette (top position is 1)
In a way, it is like having a very specialized version of LaunchBar.
Items of Note
I number the macros in the group. This makes selecting them by keyboard much easier. I would love for Keyboard Maestro to allow selection by typing characters in the macro title, but that does not seem possible.
The macros can be references to other macros. I find it much easier to keep my macro groups organized by their context. I have group for manipulating selected text and group for manipulating the clipboard. If I want both groups to showup in the same pop-up pallette, it could get a bit confusing. Instead, I create another group of macros (ctrl-space group) that trigger the appropriate macro by reference. This allows me to number them in any order and apply a more meaningful name for a macro pallette view.
I’ve mapped several macro groups to hot-keys. Since the palatte macros are triggered by the number keys, I am limited to a maximum of 9 macros per palette.
From my modest explorations, the palette must be triggered by hotkeys set on each macro and not on the macro group as a whole. If you are familiar with macro group triggers this will make perfect sense. If the palette is displayed by the “Shows a palette for one action when:” trigger then the individual macros can not be triggered by the fn+number shortcut.
-
Here’s a work flow that feels more like a hot-key macro. 1. Select some text. 2. Copy it. 3. Trigger a macro by typing a snippet like “mdr”. The snippet is removed and replaced with the process clipboard contents. ↩