Bunch of Amphetamine

Part of the Automation series

Last month I wrote about Bunch, a wonderful utility for scripting work sessions, complete with sets of apps and the ability to customize various Mac settings. Last night as I was creating transcripts for Friends with Brews,, I realized that part of my transcription workflow could be handy for podcasting as well – namely, starting an Amphetamine session.

Sounds a little extreme, you might be thinking, but it’s actually less controversial than that. Amphetamine is a Mac utility that can keep your Mac from sleeping for a predetermined period of time, with granularity. Want to let the monitor sleep, but nothing else? Can do. Want to set a trigger so that whenever a specific app is running, Amphetamine is active? Can do!

In my case, since I already set up for podcasting by running my podcast bunch, I decided to see if I could trigger an Amphetamine session on and off with it. The answer is simple – can do! The reason is William Gustafson, creator of Amphetamine, made it possible to trigger sessions with AppleScript, and Brett Simmons, author of Bunch, supports running AppleScript commands in a bunch. Problem solved.

Starting an Amphetamine session with AppleScript in a bunch script:

* tell application "Amphetamine" to start new session

The asterisk tells Bunch that the following is an AppleScript command. It’s not part of the AppleScript syntax.

Stopping an Amphetamine session with AppleScript in a bunch:

* tell application "Amphetamine" to end session

Just by adding these lines to my podcast bunch, I now have the ability to stand in front of my Mac for long podcast sessions without touching mouse or keyboard and not having to worry about the screensaver kicking on. Perfect.