mac/bluetooth proximity detection
Sunday, 3 August 2008 07:09 pmI want my work mac to lock, with password, when I'm away from it, but I'm not too keen on typing in the password when I come back. I've gotten my home desktop to do The Right Thing. The tricky part is unlocking without password, since that's not a standard feature of OS10.4 or 10.5.
To replicate, you need: mac with bluetooth, phone with bluetooth, BluePhoneElite (shareware, $25, boatloads of features I find useful [edit to add: if you don't want the other features, thisfree donationware script will do the trick], and Mac Development Tools installed.
Steps:
1) Open Script Editor, start a new script, and paste in ( this script )
2) Compile the short C program here, with the provided instructions. I stashed the executable in ~/bin/notify
Now's a good time to test the applescript, perhaps with ( this code. )
3a) If you don't want BluePhoneElite's other features, follow the rest of the instructions here to install the freebie proximity script.
3b) If, like me, you wanted to download all your text-messages off your phone when the memory filled up (instead of deleting them), you'll probably want BluePhoneElite. Give it an install (the trial is free for two weeks). Do the install-related tasks, such as pairing it with your phone. Next, handle the proximity detector: go to Preferences->Triggers and select "Bluetooth phone in range". On the right-hand side, hit the plus, add an "applescript reactor" (in the Notification sub-menu). They have a docs page which shows pictures of the general process.
Click the gear on the right; provide the filename for the AppleScript you previously saved.
It's a good idea to check the "filter" box at the bottom, and Edit Filter to choose the phone you just added. I don't know what happens if someone else's phone comes into range, but you don't want just any phone unlocking it.
And that seems to be it. I've done a bit of testing, and it seems to work consistently. I am curious whether this bluetooth activity will suck my phone's battery much faster, though.
To replicate, you need: mac with bluetooth, phone with bluetooth, BluePhoneElite (shareware, $25, boatloads of features I find useful [edit to add: if you don't want the other features, this
Steps:
1) Open Script Editor, start a new script, and paste in ( this script )
2) Compile the short C program here, with the provided instructions. I stashed the executable in ~/bin/notify
Now's a good time to test the applescript, perhaps with ( this code. )
3a) If you don't want BluePhoneElite's other features, follow the rest of the instructions here to install the freebie proximity script.
3b) If, like me, you wanted to download all your text-messages off your phone when the memory filled up (instead of deleting them), you'll probably want BluePhoneElite. Give it an install (the trial is free for two weeks). Do the install-related tasks, such as pairing it with your phone. Next, handle the proximity detector: go to Preferences->Triggers and select "Bluetooth phone in range". On the right-hand side, hit the plus, add an "applescript reactor" (in the Notification sub-menu). They have a docs page which shows pictures of the general process.
Click the gear on the right; provide the filename for the AppleScript you previously saved.
It's a good idea to check the "filter" box at the bottom, and Edit Filter to choose the phone you just added. I don't know what happens if someone else's phone comes into range, but you don't want just any phone unlocking it.
And that seems to be it. I've done a bit of testing, and it seems to work consistently. I am curious whether this bluetooth activity will suck my phone's battery much faster, though.