Switching from TextExpander to Keyboard Maestro

The makers of TextExpander recently changed their pricing model with the release of v6 from paying once for each version to a subscription. I have no problem paying for software that makes me more productive, as TextExpander certainly does.

However, v6 of TextExpander started inserting non-breaking spaces rather than normal spaces at the beginning of Python code snippets: I would paste code into TextExpander with 4 space characters in a row, and it would come out with 3 NBSPs and one normal space. This effectively broke TextExpander for some of my most-used snippets.

Additionally, I've always had quality and stability issues with TextExpander and Smile's other product, PDFpenPro. For example, in TextExpander v5, it was impossible to tab from the snippet entry field to the abbreviation field. This infuriating problem was left unresolved for all of v5, but was thankfully fixed in v6. And PDFpenPro is simply much less stable than the alternatives (Preview.app and PDF Expert), with fairly frequent beachballs and freezes.

TextExpander v6 requires syncing to their central server. Given the software quality issues with their stand-alone apps, I'm very concerned about snippet loss from sync errors. I'm also not convinced that the QA issues with their native applications will ever be resolved, especially with the added burden of their new sync/subscription business model. And I am skeptical that their new business model will be sustainable long-term, given these other issues and the response of many users to their subscription pricing.

I decided it was time to look for an alternative.

Keyboard Maestro

Keyboard Maestro is general-purpose Mac automation software, which also has the capability to expand text snippets like TextExpander. I manually migrated my snippets over in about an hour (it can be done automatically too).

What I like

  • Keyboard Maestro (KM) seems generally more stable and performant than TextExpander (TE).
  • KM's two column UI for listing snippets is much more effective than TE's single column with collapsable headings.
  • KM allows multiple snippets with the same shortcut: when you type a conflicted shortcut, it shows a pop-up menu where you can select the snippet you want.
  • KM does lots of things besides snippets, like letting you ctrl-tab between multiple windows in the same application!

What I don't like

  • The KM quick search doesn't show the shortcut for the snippet (TE's quick search does).
  • Setting up new snippets in KM is a bit more complicated than with TE. This is because KM is a multi-purpose tool, and there are definitely benefits to specialization. But at least the tab key works as expected.

Other than these minor complaints, I've had zero problems with KM.

Setting up text expansion in Keyboard Maestro

Here's what my text expansion snippets ("macros" in KM parlance) look like – it seems like it's necessary to reset the system clipboard after expanding the snippet if you use the "paste" insert method rather than the "type" method:

Implications for this website

I've posted a number of tips on this site that use TextExpander. So far I have been able to convert these to Keyboard Maestro macros with minimal effort.

From now on, I will be posting KM macros rather than TE snippets.

Download Files (Like PDFs) Open in Safari to the Current Finder Folder

I often click PDF links in Safari, and the PDF will open in that Safari window rather than downloading. This is ok with me. I don't like a bunch of files cluttering my ~/Downloads folder.

But when I do want to download one of these PDFs, there isn't an easy way to do it. There is no "Save As..." in the right click menu, and the HUD buttons at the bottom of the viewer are hard to reliably bring up.

Enter this Automator workflow, which I trigger with LaunchBar. It will download the file (PDF or otherwise) in the frontmost Safari window into the frontmost Finder window's folder, or to the Desktop if no Finder windows are open. Download it here.

List of Ruby's % operators

Compiled from this Stack Overflow answer, here is the list of Ruby’s very useful % operators:

  • %w() creates an array from space-delimited strings (a b c becomes [‘a’, ‘b’, ‘c’])
  • %r() is another way to write a regular expression
  • %q() is for single-quoted strings (so you can do %q(that's right) without escaping the '
  • %Q() is for double-quoted strings so you don't have to escape ", but can do interpolation (%Q(#{1+1}) => "2")
  • %x() is a shell command
  • %i() gives an array of symbols (Ruby >= 2.0.0)
  • %s() turns foo into a symbol (:foo)

How to Strip Photo Metadata in the Terminal with exiftool

If you want to strip metadata from photos (e.g., location data from your phone's GPS), there are a few ways to do it:

  • On iOS, I recommend Metapho.
  • On Mac, you can use the built-in Preview.app, and there are lots of apps in the App Store of dubious quality that do this.

There's another option for Mac if you want to use the Terminal: exiftool

You can get exiftool with brew install exiftool, and then you can use this command to strip all the metadata from a photo:

exiftool -all= /path/to/file.jpg

You can verify that it worked with exiftool -a /path/to/file.jpg | grep GPS. Try running this before and after the previous command, and you can see how the GPS info is removed.

I have added the following to my .zshrc file for quick access to these commands:

alias exifstrip='exiftool -all='

function exifgps(){
    exiftool -a "$1" | grep GPS
}