42 Astoundingly Useful Scripts and Automations for the Macintosh

Astoundingly useful programming tools

One thing hasn't changed since the seventies: some of the most useful programs are programs created for programming.

Jerry Stratton

Installing new tools with brew—Saturday, November 30th, 2019

“The missing package manager for macOS (or Linux)”

Homebrew is a very useful tool to install on your Mac. As I described in Photo-editing with Persistence of Vision, you can use it to install new languages that don’t come with your computer.

You can also use it to keep the languages that did come with your computer up-to-date. Python, for example, is notoriously out of date on the Macintosh’s default installation. With Homebrew, you can keep both the latest copy for your own scripts while not harming the default installation for the built-in scripts from Apple.

Homebrew is very neat for the applications you can install. You can use it to install Inkscape, for example, which is a full-featured drawing application. If you want to go old-school, you can install a text-oriented browser on the command line, such as elinks, links, or lynx.

If you really want to go old-school, install adventure.

As Apple starts removing scripting languages from the Mac, Homebrew will become more and more an essential tool for weekend scripters.

A scriptable text editor for iOS—Saturday, November 2nd, 2019

Editorial is a plain text editor for iPad and iPhone with powerful automation tools and a beautiful inline preview for writing Markdown. You can combine a large selection of simple text processing actions into your very own workflows—all in an intuitive drag’n’drop interface that makes it easy to see what's happening.”

The author of Pythonista also has a text editor on the app store. But Editorial isn’t just a great text editor; it’s also a great way of running scripts on text documents. I use it extensively when writing blog posts, to format my posts, to create lists, and to look up information on the fly on my own web site and others.

The drag-and-drop workflow creator is very powerful, and incorporates many of the features of Pythonista while keeping those features extraordinarily simple to use.

An alternative to the crontab file—Saturday, October 12th, 2019

Mac OS X contains a powerful alternative to cron, called launchd. Unlike cron, launchd can run scripts not just based on time of day but on repeated intervals; it can also ensure that scheduled scripts run when the computer starts up if the computer is turned off when their scheduled time comes around.

Launchd can also run applications that need assistive access, making it possible to schedule such apps without using an AppleScript app running all the time in the background.

Launchd is also, however, a lot more complicated to set up than cron jobs. I still use cron for most scheduling because cron is easier to maintain. Lingon, however, goes a long way toward making launchd almost as easy to use as cron. This is the only case in the book where I do things differently than I describe: I use Lingon to tell launchd to run an Automator app that runs the schemail e-mail scheduler.

I didn’t want to require you to buy third-party software. But I do recommend it if you use schemail but don’t like having an AppleScript app running all the time.

Is It Worth the Time?—Saturday, September 21st, 2019

“How long can you work on making a routine task more efficient before you’re spending more time than you save? (Across five years)”

The fact that someone actually made this chart up is funny, but in fact it’s quite useful. Douglas Adams’s quote about spending a full day writing a program to save ten seconds notwithstanding (see the book), writing a program almost always takes longer than performing the task once. The issue is, will writing the program save time over the long run?

If you perform a task five times a day, and you manage to shave ten seconds off of it, that’s worth spending a day or two of programming, at least if you’re going to be performing the task for five years or more. Back when I had a nine-to-five (well, technically, seven-to-three) job, I kept this chart posted on my wall next to the computer.

There were times when wasting the ten seconds is so easy, and writing the program was so uninteresting, that I didn’t feel like writing the program; this chart helped motivate me. And there were times when the savings were low but the program interesting, and the chart helped convince me not to waste the University’s time.

Now that I’m programming for myself, of course, interesting holds more importance.

Older posts