Hi, I'm Henrik Joreteg
I'm a happy, geeky, husband and dad. I love skiing, web dev stuff, and independent thought.
Joreteg.com is where I occasionally write about the things that interest me and come spilling out of my brain.
I live in West Richland, WA and happily work as JS developer/president at &yet.
Contact
Email:
Or you can just push this big button to call me:
Links to My Other Stuff
Latest From Twitter
7th
2010
How to magically run stuff when you’re near your Mac… or not
What you need
- A Mac
- Some type of bluetooth device you always have with you (let’s get real, if you’ve got a mac you’re using an iPhone)
Step 1.
Download and install Proximity:

Step 2.
Open AppleScript editor and create a script to run when you’re near your computer. Mine is super simple. It just turns off the screen saver and sets my chat status in “Adium” (if it’s running) to available. But obviously you could do anything you can do in AppleScript. Mine looks something like this:
tell application "ScreenSaverEngine" to quit
if appIsRunning("Adium") then
tell application "Adium" to go available
end if
on appIsRunning(appName)
tell application "System Events" to (name of processes) contains appName
end appIsRunning
And create another one for when you’re away. Once again mine’s super simple:
tell application "ScreenSaverEngine" to activate
if appIsRunning("Adium") then
tell application "Adium" to go away with message "Appears to have stepped away for a bit."
end if
on appIsRunning(appName)
tell application "System Events" to (name of processes) contains appName
end appIsRunning
I saved these two scripts in a “Scripts” folder I created in my home directory (fancy that!).
Step 3.
Now all you have to do is give tell Proximity which script to run when and which bluetooth device you want it to look for. If Proximity is running you’ll see a small (somewhat ugly) bluetooth lookin’ icon in your toolbar. Click it to open preferences. My preferences look like this:

Step 4.
Tell @HenrikJoreteg on twitter that it worked for you and that you’d give him a high-five if you were within reasonable high-five range.
