jasonkenison
theWebGuy
    new stuff:
    blog archives:
#blog
thoughts: anything goes

IM STATUS APPLESCRIPT

Aug 24, 2006

Note: this blog posting is pretty old and it may no longer be relevant.
IM Status AppleScriptI've been searching all over the place for a simple way to set my instant messenger status without needing to change it in every chat client I've got running. I run iChat for AIM and Jabber (Google Talk) accounts, AdiumX for Yahoo!, ICQ and MSN, and Skype for VoIP. So, if I get up to pee, or something, I've got to set myself as "Away" in 3 apps before I go.

With OS X 10.4 Tiger, I assumed Automator would be full of useful tools to make this a simple task, but unfortunately Automator's options for iChat is limited and non-existent for Adium and Skype. I found an AppleScript that included some iChat reference of changing settings, and after some trial-and-error, was able to come out with this:

set myStatus to display dialog "Select your IM Status:" buttons {"Away", "Available"} default button 1

tell application "iChat"
  if the button returned of myStatus is "Away" then
    set status to away
  else
    set status to available
  end if
end tell

tell application
"Adium"
  if the button returned of myStatus is "Away" then
    set my status type to away
  else
    set my status type to available
  end if
end tell

tell application
"Skype"
  if the button returned of myStatus is "Away" then
    send command
"SET USERSTATUS AWAY" script name "My Script"
  else
    send command
"SET USERSTATUS ONLINE" script name "My Script"
  end if
end tell

Running this AppleScript will pop up a dialog box that gives you 2 options: "Away" and "Available". Clicking on either will update all 3 chat clients with a mere 3 clicks... 1 double-click to open the script + 1 click to set your status.

Seems to work well for my needs, although I'd love to figure out how to toggle the status and bypass the dialog box all together... anyone have any ideas?

Download IM Status* (AppleScript and compiled app included)
   (*Mac OS X and latest iChat, Adium and Skype required for script as-is)

 

6 comments –Comments Closed–

jimbob Aug 30, 2006
 
Very helpful, thanks!
 
Anonymous Sep 4, 2006
 
I've got multiple IM handles in my Adium installation. Will this script set the status for all?
 
Re: Anonymous
jasonk - jasonk at jasonkenison dot com
Sep 4, 2006
 
Yeah, I run AIM, MSN, and ICQ in Adium and it sets the status for all. They've all got the basic "away" and "available" settings even though each has their own brand of customized statuses.
 
shawn Oct 29, 2006
 
Very cool script. I have a suggestion to skip the dialog window.
Split your script into 2 scripts. One that sets everything to Available. Another that sets evething to Away.
Now save them so the appear in your scripts menu [Library > Scripts folder].
One click to pulldown the menu and let go on which ever status you want to be at.
 
Re: shawn
jasonk - jasonk at jasonkenison dot com
Oct 30, 2006
 
You know, you're right... thought using Automator would make things easier, but that Scripts folder version seems to work much better, and only 2 clicks rather than 3... it's faster too.
 
Hiren Nov 15, 2006
 
A neat thing to do is to add yourself to your contact list in Adium, and then add events that watch when you go away/online/offline/invisible. I've got a script which then checks your status in Adium, and then applies it to Skype, and sets your mood message accordingly. It's a pity you can't set up Adium to fire events when your online status changes, because then you could have complete synchronisation between Adium and Skype. It's trivial to get this working for iChat too, if anyone feels like doing it.

http://penguins.mooh.org/files/skypeadium.txt
 

 
↑ Top