Throwaway macros and snippets

It’s funny how you sometimes have to relearn the lesson you thought you learned years ago. When I first started using TextExpander, I was a snippet miser, but eventually I learned to loosen up and create snippets that might be needed for only a single day. Despite seeing how useful it is to make these temporary, throwaway snippets, when I started using Keyboard Maestro, I was a macro miser. It’s only recently that I’ve relearned the TextExpander lesson.

In the early days of my TextExpander use, I didn’t make nearly as many snippets as I should have. There are, I reasoned, a limited number of good, short abbreviations, and I should save them for snippets that I was likely to use for a long time. So I didn’t, for example, create snippets that I’d use only for a single report. But that was foolish. If I have to repeatedly type a longish product name in a report, it’s worth making a snippet even if I’ll never type that product name again. The time it saves me is less important than the frustration. If I have to type the name myself six times, I will undoubtedly mistype it at least twice. Maybe I’ll get the capitalization wrong, maybe I’ll screw up where the hyphens are, maybe I’ll mistakenly type the name of a similarly named product—whatever the possible errors, I’ll be sure to make a couple of them.

This is the less-discussed, but no less important, advantage of automation. The automated solution delivers the same result every time. It’s mind doesn’t wander, its fingers don’t reach for the wrong spot. It’s consistent.

And it’s not like I have to keep these temporary snippets in my TextExpander library forever. When the project is over and the report is written, I can delete my snippet for Buck-U-Uppo, freeing up the ;buu abbreviation for something else.

So after learning this lesson for TextExpander, you’d think I’d avoid making the same mistake with Keyboard Maestro. No. But I am relearning. This past week I had to create a bunch of CSV text files from certain rows and columns in a few spreadsheets of data sent to me by a colleague. The procedure was this:

  1. In Numbers, select the cells needed.
  2. Copy.
  3. Switch to BBEdit.
  4. Open a new document.
  5. Paste.1
  6. Save under an appropriate file name.
  7. Switch back to Numbers.

Most of these steps can be done with keyboard shortcuts, so it’s not especially time-consuming, but after the second time I did it, I realized I’d never be able to create a few dozen files this way without getting the sequence wrong or stumbling in some other way. So I made this Keyboard Maestro macro:

KM temporary

It covers Steps 2 through half of 6. It brings up the file save sheet, but leaves it to me to fill in the name of the new file. I had hoped to use one of Keyboard Maestro’s pause commands to allow the macro to pick up after I’d entered the new file name and finish Step 7, but after my first couple of attempts failed I decided to leave that step unautomated and get on with it. The creation of the CSV files went smoothly.

I put the “Temp” at the end of the macro’s name to remind me to delete it when this project is over. I should know by the end of this week whether I’ll need to use it again.

I’m not yet a Hazel user, but I have a feeling that’ll change sometime this year. I’m hoping I recognize the value of temporary rules right away, but I won’t be terribly surprised if I don’t.

  1. Sharp BBEdit users will note that Steps 4 and 5 can be combined in a single File‣New‣(with Clipboard) menu selection. But this menu item doesn’t have a keyboard shortcut, so the ⌘N ⌘V sequence is faster.