This entry was posted on Tuesday, March 27th, 2007 at 9:40 PM and is filed under Apple, Mac, Microsoft, Programming, Security, Software, Windows. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
I first saw this nice little trick a year or so ago. A fellow admin and friend of mine, Tommy, used a Bluetooth® headset to automatically lock his Windows machine whenever he stepped away from his computer and his headset was no longer in range of his PC’s Bluetooth® dongle. I don’t remember how I stumbled upon this blog post yesterday, but I am glad I did. This post shows you how to implement a similar solution using an application called Proximity and some AppleScripts to achieve the same result.
The cool thing about this solutions for the Mac is that the events that are triggered when the specified Bluetooth® device enters and leaves the Mac’s Bluetooth® proximity are AppleScripts. AppleScripts allow you to easily program for the Mac. AppleScripts are pretty much the same thing as shell scripts for any other operating system and command line environment, like batch scripts for Windows and Bash or C Shell scripts for Unix based and derived operating systems like Linux and FreeBSD. Basically, with a solution like this, you aren’t tied to the developer’s ideas of what should happen when you step away from your machine. The ball is totally in your court and your goal is only limited by your creativity and your programming ability.
The AppleScripts I modified for my implementation and the C program for updating the Mac system on the fly can be found using the URLs below:
The source code for each of the above scripts and the notif application can be found using the URLs listed here:
In order to get the above scripts to work, I had to navigate to /System/Library/Frameworks/ScreenSaver.framework/Resources/ and copy ScreenSaverEngine.app into my systems /Applications folder. For some reason when I ran the scripts initially the interpreter would ask me where ScreenSaverEngine was. I believe I found this fix in the comments on the original article posted above. Anyway, if this doesn’t work for you right off the bat, copy the ScreenSaverEngine.app application into your /Applications folder and you should be good to go.
Here’s what happens when my Nokia E61 and myself walk away from my MacBook (Proximity is set to check for my phone’s presence every 10 seconds):
- Proximity enables my screen saver which is password protected.
Simple enough, eh?! Here’s what happens when my phone comes back in proximity of my MacBook’s:
- Proximity stops
ScreenSaverEnginewhich kills the screen saver and returns the MacBook to the desktop and any applications that were previously open and running. - Proximity checks to see if my E61 and my MacBook have sync’d calendars and contacts within the last 15 minutes. If not, iSync is fired off in the background and the phone and the laptop pair up and sync. If the calendar and contacts have been sync’d within the past 15 minutes, this step is ignored.
And, that’s that. It is pretty limitless to what events you can have triggered each time the Bluetooth® device you specify comes into and out of the Bluetooth® range of your Mac. For example, you could have iTunes pause when you step away and continue playing when you return. Hey, why not go a step further. Set Proximity up for your bosses Bluetooth® enabled cell phone (one note, you can only have one Bluetooth® device setup to be monitored by Proximity… this example is only for humor purposes) and when he or she gets within range of your Mac, have Proximity minimize World of Warcraft that you play all day at work in between help desk phone calls.
Anyway, I basically used the original author’s scripts as they were written and posted. I only made minor modifications to his needs within the scripts but I can see this expanding in the future as I learn AppleScript and would like other events triggered upon my arrival and departure in and from MacBook world. Again, I think this is an extremely cool idea and am really glad I stumbled upon it yesterday. I am also extremely grateful that the developer of Proximity, Denver Timothy, releases this application free of charge (donations are of course welcome).
Until next time…



























March 28th, 2007 at 7:40 AM
[...] posted at cocoacrusty.com on March 27th, [...]
From