2007-04-19

AppleScripts to control Skype and Adium from BluePhone Elite

AppleScriptBluePhoneElite

I have been using BluePhone Elite for a few months. This is a very cool piece of software that connects to your cell phone (if it is among the many supported models) over Bluetooth and among other things can perform actions upon certain events such as starting a call, ending a call, etc. It also has a proximity feature which is based on being able to connect to your phone over Bluetooth. Since the Bluetooth in Macs (and most cell phones) has a maximum theoretical range of 10 meters, and in practice much less, this works quite well. One of the actions that BluePhone Elite can perform upon an event is to run an AppleScript.

I found a number of AppleScripts on BluePhone Elite's download page. However, I found them all quite crude and unsuitable for me. In particular, none of them checked to see if the application was already running before telling it to change the status (here's how to do that). This has the effect of launching the application if it's not already running. Not a desirable effect on an event triggered by you walking away from the system. So I did a little research into AppleScript and wrote my own.

Here are the ones I wrote to control Skype and Adium:


  • : Sets the away status on Adium and changes the away message in Adium and the "mood" message in Skype to "I'm on the phone..." It can optionally take Skype offline if you un-comment that line.
  • : This one undoes what the previous one does. Removes messages in both Adium and Skype and sets both to "available". It can optionally put Skype back on-line if you un-comment that line.
  • : This is like
    IM - On The Phone
    but uses a different message to indicate that the user has left the computer. For use with the proximity feature.
  • : This is like
    IM - Available
    but also speaks "Welcome back" through the speech synthesizer to give you a verbal acknowledgment that it has detected that you're back.

Of course, these scripts are very easy to edit so you can customize the functionality to suit.

Note: Since I have both a MacPro desktop and a MacBook Pro laptop, I've placed these in my iDisk so that they're available to both. It doesn't matter where you place them, just point BluePhone Elite to that location when specifying the AppleScript you want to run.



Here is a screen shot of the configuration pane to enable the scripts upon incoming calls (I've also enabled them for outgoing calls):



And one that shows the configuration of the proximity feature:



Enjoy!

0 comments: