So I've put together a script to update my iChat status, and it has evolved over time. It used to work with iChatStatus, but now iChat AV is scriptable, so I can update the status message from Mac::Glue.
The script I use now is called happening, and it forks itself into the background (startup of Mac::Carbon stuff is still pretty slow and processor-intensive in dyld, so it stays running all the time ... besides, I set it to run every 15 seconds anyway), and then runs through a series of checks on each loop.
It first looks to see if I am watching EyeTV locally, then looks to see if I am listening to an MP3 in iTunes. Then it calls another machine, executing a similar script, to see if that machine is running EyeTV or iTunes (right now this is done via ssh, but I am going to rewrite that remote script to also be a daemon, and have it write out a file I can check via HTTP; much more efficient).
If all those fail, it shows the current app, and if somehow that fails, it puts up something from fortune(6).
It makes heavy use of Mac::Glue to talk to iChat, iTunes, EyeTV, and System Events. It's super sweet! Note how it caches objects it is going to reuse ... makes it super fast and efficient, too. There are a bunch of me-specific things hardcoded in it ... sorry if that gets in your way. :-)
Here are the key lines for talking to iChat:
$message = $ichat->prop('status message');
$message->set(to => $output);
Re:scripting documentation
Fletch on 2003-06-25T13:39:47
Just fire up the AppleScript ScriptEditor app and use File -> Open Dictionary to get all the info. Of course a glue-to-(pod|rtf|html) convertor might be an interesting alternative . . .
Oh, and Pudge++ for Mac::Glue.
Re:scripting documentation
pudge on 2003-06-25T14:29:28
gluedoc accepts several of the flags perldoc does.gluedoc iChatRe:scripting documentation
drhyde on 2003-06-25T14:55:39
Ooh! Shiny!