Skip to main content

All the Ways I Automate

Scripting and automation have been in the conversation lately, owing to Apple's reported disbanding of the macOS team responsible for them and the departure of scripting advocate Sal Soghoian from the company last month.

They sounds like arcane, abstract concepts. And to be sure, scripting and automation are the sort of feature that's used by more like 5% of users rather than 50%. But in pondering Apple's possible shift in automation strategy, I began to consider all the ways I use it in my working life.

Why automate?

The first question is the biggest: Why is this stuff necessary? The short answer is that computers are really good at repetitive tasks, and humans aren't. We all know that our computers make our working life easier in innumerable ways, but when you come to a task that your computer just can't do because it requires a feature that your operating system or app of choice just doesn't offer, you're left with two options. One is to dive in and do that task by hand, and the other is to build something that will do that task for you.

The calculation with automation is always time saved versus time earned. If the task you're performing is a one-off that will take a half-hour, it's probably not worth spending an hour building a script to do it in seconds. But if you do that half-hour task every day or week, that investment of an hour suddenly becomes a no-brainer. You'll save far more time than you'll spend.

The calculation with automation is always time saved versus time earned.

It's still not quite that easy, though, since building automation usually requires some specialized learning; knowing AppleScript or shell scripting or command-line commands helps, and even getting up to speed on Automator can take time. Even the simplest automation systems, that let you build up actions block by block, are probably more than what most people will prefer to do. But for the people who do want to bother, they will find their investment in learning how to create automations rewarded.

Where I automate

I produce a whole lot of podcasts, and a lot of the work that goes into generating podcasts has to do with converting and processing audio files before the proper edit begins. I've built and acquired various Terminal commands and shell scripts that manage to do in one go what used to take me several stops in different apps.

For example, I've got a command that uses ffmpeg to extract track one from a QuickTime file generated by the Skype Call Recorder utility, and another that converts pretty much any file into a mono WAV. I use Marco Arment's as-yet-unreleased sidetrack command-line utility to sync up podcast audio files before editing, too.

Those three tasks, which previously required me to open Terminal and drag in a bunch of files in the right order, are all now available to me via keyboard shortcut or contextual menu in a Finder window. I do this by using Automator's Run Shell Script block to build a simple Automator Service. Services appear in the Services submenu in individual apps, and also show up in the contextual menu that pops up when you control-click on a Finder item. You can also bind these Services to keyboard shortcuts via the Keyboard pane of System Preferences.

When the Internet's Dr. Drang posted a script to process Southwest Airlines calendar downloads to make them more useful, I wrapped his script in an Automator Service, so now I can just control-click on a Southwest download and instantly transform it via his script.

And every time I post an image to Six Colors, I do it via a Service; I control-click on the image, select my service, and in the background the image is opened in Photoshop, resized to proper specifications, saved out as a JPEG with a specific quality setting, and then uploaded to my web server via the Transmit app. As a coup de grace, the proper HTML I need to paste into my story to display the image is placed on my clipboard. (That magic all happens via an AppleScript script I wrote a couple of years ago. It's still paying off every time I post an image.)

Automation is everywhere

Sometimes automation is about modifying files, but sometimes it's about connecting apps together in unplanned ways. This is generally where AppleScript comes in the most handy, though these days you can also use JavaScript (opens in new tab) to control Mac applications. (In my most optimistic moments, I envision a future where Swift becomes not just a great language for learning programming and writing applications, but for scripting Mac apps as well.)

Sometimes automation is about modifying files, but sometimes it's about connecting apps together in unplanned ways.

Of course, some apps can take advantage of scripting languages internally. I just added a perl text-processing script to BBEdit and attached it to a keyboard shortcut.

But automation doesn't have to be complicated scripts, command-line utilities, or even supplied by Apple. There are excellent Mac apps that can make your life easier without much programming. Hazel will process and organize your files. Keyboard Maestro lets you build complex automations of clicks, keyboard shortcuts, and logic--to be honest, it's what I had hoped Automator would be, but never was.

Even on iOS, a system that was never designed to support scripting and automation, life has found a way. Developers have taken advantage of the ability of iOS apps to pass URLs back and forth to create a system of inter-app communication. The app Workflow is the Automator that was never written for iOS. Launch Center Pro gives you shortcuts to specific tasks.

Even on iOS, a system that was never designed to support scripting and automation, life has found a way.

You can write code in Python using Pythonista, but you can also create powerful Python-based macros inside the Editorial text editor. I use 1Writer frequently on my iPad, which features a JavaScript-based Macro language of its own. And there are many others.

Life goes on

So while I'm sad to see Apple's commitment to AppleScript and Automator waver, the fact is that automation features are just too useful to vanish. Even if Apple didn't really care about these sorts of features, the users would find ways to make them work. The options available on iOS are proof of that. (Though with a little help from Apple, they could be much better.)

Either way, I will continue to use my Mac (and my iPad, for that matter) as a tool to get my work done, and I will keep building little bits of connective tissue to make it easier for me to do that work.

Former lead editor at Macworld for more than a decade, wrote about Apple and other tech companies for two decades. Now I write at Six Colors and run The Incomparable podcast network, which is all about geeky pop culture, and host the Upgrade and Clockwise tech podcasts.

10 Comments
  • Thing is - obviously Apple was onto something when they added scripting to applications a long time ago. KDE has hooks to do scripting with UI applications too although there is no such thing as a layman language like AppleScript. I must say that I think your Swift idea is pretty neat. How hard would it be to be able to call AppleScript entry-points in applications from Swift?
  • Beauty of Swift is it may allow Apple to "reinvent" automation so that it works across all of Apple's devices: iPhone, iPad, Mac, Apple TV, Watch
  • This.
    I've been waiting for the opportunity to activate Airplane mode across all my iCloud devices, set a timer and invoke a Night Stand app so I can meditate in peace at a given time window with one click or Siri command. As things stand, only Do Not Disturb can vaguely accomplish one of those tasks, and access to the key API's remain blocked to 3rd Party automation apps. I'm confident though that by the time Apple goes down the route of retiring Automator, it will have eased the restrictions on 3rd party apps to the extent that even greater extensibility than presently available would be made possible.
  • I think the one thing that's lost in this article is that for all the tools of automation to work the apps need hooks to allow it to happen. I would like to see swift fill the AppleScript void, but why would they get rid of Sal if that's all there was to it. He was one of their best evangelists. Minor note - why are articles on this site always quoting a sentence from the previous paragraph. Looks ridiculous, emphasize the sentence you want noticed.
  • Jason, do you think automation is at odds with Apples increasingly strict stance on privacy? iOS is a system that's walled up by design to be more stable and secure. It seems to me that the goals of security and privacy severely get in the way of automation. I mean, yes, they added some hooks in iOS 8 to make inter-app communication much more capable, but given the diverse and unique needs of automation, it seems like it would be hard to add the right system-level hooks to suit everyones needs for automation... It's my theory that Apple began to realize that automation capabilities are getting in the way of privacy and security on macOS, thus the automation group became unnecessary. I hope I'm wrong...
  • It would make more sense if you explained how automation makes the operating system less secure or less private. Just saying it doesn't make it so.
  • I think people have read far too much into this whole thing. AppleScript and Automation is a very important part of Mac OS. That said since the introduction of Automator it's been in cruise control. These powerful tools are no more accessible to the average consumer than they ever were. If there is any fault here it resides with the previous product manager who didn't, or wasn't allowed, to take the promise of Automator and further extend it beyond traditional geeks, publishing, etc. If Automator and AppleScript die I will say this process began the day after Automator was released. Anyone that follows Apple should have learned long ago that any feature that doesn't pass the "mom test" or "can and will my mom use this" is at risk. Simple as that. The previous product manager should have seen that and worked to overcome it. Fo what ever reasons, where ever the fault lies, that didn't happen and that's unfortunate.
  • I tend to write my own scripts just because I know what I want. I write them bash so its pretty simple. If I want a Cron job to run I just have it on a schedule in crontab. Simple yet effective.
  • I'm good at repetitive tasks....
    I'm good at repetitive tasks. The only automated thing i do is encode video to audio files, but heck... I should be doing a lot more than this.. ;P
  • Automation is more than just time saved versus time earned. Another important benefits are increased reliability/repeatability/consistency - if you do it manually, chances are you'll do it subtly differently each time, and/or occasionally make mistakes. Another intangible benefit is simply the joy of watching the computer do what you have told it to, and similarly, the joy of removing the rough edges that the OS or some application has left that irritate you. "time saved versus time earned" is an important metric, but consistency and joy are less easily measured but perhaps even more important.