How-To: Proximity Automation

Proximity application icon

Would you like to be able to use the magic of Bluetooth to automatically pause iTunes, set your away message in Adium, and lock the screen simply by standing up and walking away from your desk? Of course you would — it’s future-tastic (jetpacks not included)! Let’s take a look at how to pull this off.

What You’ll Need

First you’ll need a copy of Proximity, a handy (and free) little application which monitors your Bluetooth-enabled device and fires off AppleScripts when it leaves and enters connection range. As an added touch, we’ll also use a copy of DeskShade to lock and unlock the computer with style, leaving a nice away message displayed on the screen and opening a “Hacker Log” to display what activity took place while you were away.

DeskShade actually does a lot more than just allow AppleScript to lock and unlock your screen. I won’t go into a full review of it here, but essentially, it will also help keep your desktop clean, your wallpaper fresh, and your mind uncluttered. If, however, you want to forgo the use of DeskShade, you can instead lock and unlock the computer by having AppleScript launch your screensaver and adjust the security settings required for waking it up. AppleScript files for both approaches can be downloaded here (8kb, ZIP).

Screenshot of the scripts used in this tutorial

Getting Set Up

Install Proximity, and from within the preferences pane select your Bluetooth device. I used my iPhone, but any “discoverable” device should work. In the AppleScript section link to OutofRange.scpt for when the device moves out of range and InRange.scpt for when it moves back in range. Make sure that monitoring is enabled and set a frequency for proximity checks — I used 60 seconds. If you decided not to go the DeskShade route, then just swap in the second set of scripts for that step above and skip ahead to the testing.

Install DeskShade and on the DeskLock tab set a password, enable AppleScript to unlock, set the Hacker Log to open after unlocking and set the away message to something appropriate. I used the same “More than 30ft away from my computer” message that is set in Adium via the out-of-range script.


Future Perfect

It’s as simple as that. Get up and take a walk around to test it out; by the time you get back, your computer should be unlocked, and you can have a look at the Hacker Log to see what happened while you were gone. Now all we need are jetpacks, flying cars, and a reliable way to prevent “sock-loss” when doing the laundry, and it will be future perfect.

You're subscribed! If you like, you can update your settings


Comments have been disabled for this post