-- Adium : set as available if appIsRunning("Adium") then tell application "Adium" go available end tell end if -- Skype : set as available if appIsRunning("Skype") then tell application "Skype" send command "SET USERSTATUS ONLINE" script name "Proximity" end tell end if -- Colloquy: change nick back to normal if appIsRunning("Colloquy") then tell application "Colloquy" set aC to every connection repeat with conn in aC set aR to (every chat room of conn) repeat with room in aR set nickname of conn to "beaulebens" end repeat end repeat end tell end if -- iTunes : play music if appIsRunning("iTunes") then tell application "iTunes" play end tell end if -- Start Screensaver (which locks the screen) tell application "ScreenSaverEngine" to quit -- Log Movements set logFile to "/Users/beau/util/proximity.log" open for access logFile with write permission write "BACK: " & current date & "\n" to logFile starting at eof close access logFile -- Helper on appIsRunning(appName) tell application "System Events" to (name of processes) contains appName end appIsRunning