Airlock + Scripting
Posted December 11, 2009 @ 12:42 pm
I’m a big fan of automation. Big fan. So when something like Airlock comes along, I buy it immediately (and for $7.77, you can’t go wrong).
Airlock will lock and unlock your Mac for you based on the proximity of your iPhone. Super-neat. But! It doesn’t use Apple’s built-in screen locking feature. Rather, it has its own screen-saver-cum-progress-bar lock screen that, while very pretty, didn’t make me happy. Because I’m on a Mac, and I want to use the stuff that’s built in.
Luckily, Airlock will also run applications when you leave and return to your Mac. What I did to make myself (and my OCD) happy was to replace the built-in lock feature with a couple of AppleScript applications, which you can download (along with their scripts) here (update below).
Download the file, unzip it, and drop the apps…wherever you like. Then, set up your Airlock install like so:

And be sure to turn on access for assistive devices in the Universal Access system preference, like so:

Finally, enable password protection in the Security system preference, a la:

Done. Now, when you leave your computer, iTunes will pause, iChat will change your status to “Away” and your status message to “Away from my desk,” and the screen saver will activate.
When you return, iChat will change your status and your status message to “Available,” and you’ll be prompted to enter your password.
Love. It. Just wish that the app was a bit more responsive without the battery drain, but that’s hardly the fault of the developer.
UPDATE (12.11.09 @ 9:51 CST):
I noticed after using these scripts/apps for a bit that I needed to beef them up a little more to handle cases when iTunes and iChat aren’t running.
I’ve posted the WalkingAround and NotWalkingAround scripts as gists on GitHub. Paste these into a new document in AppleScript Editor, click File, choose Save As…, select Application Bundle from the File Format menu, and click Save. This creates an app that can be used with Airlock.
Finally, it would NOT suck if you used all of this with the Mr. Sparkle screensaver (via).