Perceive

Proximity (or "So Close, But So Far Away")

I recently had a problem with my Mac. A sector on the hard drive went bad, and killed one of the files for Salling Clicker. It's a great program that allows you to run scripts when you go away from your computer and return, using bluetooth to determine if you're in rance of your computer. It also allows you to control applications on your computer via your mobile phone. Quite a cool app, but the only part I used was the proximity part.

So after reinstalling OSX (which seemed to be my only recourse to get the abd sector problem resolved), I decided to look and see if there is something like Salling Clicker that only does the proximity part (which is all that I used). I found the aptly named Proximity and it perfectly fits the bill.

Unfortunately the Proximity website doesn't have any applescripts for you to use, so I had to write my own, and I thought I'd write them down here for you lovely readers to use. I found some part of these at the Technocrat blog.

In Range Script:

-- iTunes
--
tell application "iTunes"
play
end tell
-- Adium
--
tell application "Adium"
go available with message ""
end tell
-- Sync the phone (if not synced in the last 60 minutes)
--
tell application "iSync"
if last sync is less than ((current date) - 3600) then synchronize
end if
end tell
tell application "System Events" to set visible of process "iSync" to false

Out of Range Script:

-- iTunes
--

tell application "iTunes"
if player state is playing then
pause
end if
end tell

-- Adium
--
tell application "Adium"
go away with message "I'm not near my computer"
end tell
Tags
    Related Links Elsewhere