So last monday I thought it would be fun to update my Adium buddy icon with how I currently look by taking a new image with the iSight camera that is built into my MacBook Pro. The reason was that I was wearing a suit with necktie and everything to work, something I don't usually do.
One of my IM buddies , Peter Krantz, saw this and commented in shock and awe claiming that was no way for a developer to dress. But he also had a really nice idea - that it would be cool to be able to get an updated image of your buddies every minute or so so you could see how they were looking today and if they where truly available or away.
I thought it was a nice idea and knowing that most OS X applications can be scripted through AppleScript I figured that it might be possible to implement this for Adium. I soon discovered that you can't take a iSight picture directly from AppleScript, but you can invoke a command called isightcapture that will accomplish this. After poking around in the AdiumXtras AppleScript section I also found some samples of how to change the buddy image. All that was remaining was a few hours of fighting with the weirdness that is AppleScript so I can present this little snippet to you:
1 display dialog "Do you want to update your buddy picture?"
2 do shell script "/Applications/isightcapture " & POSIX path of file "Macintosh HD:private:tmp:buddyicon.jpg"
What it actually does: Asks you if you want to update your picture, if you do it will take a snapshot with your iSight camera and set it as your default image in Adium (be sure to select the global buddy icon for all accounts for this to work).
What I haven't figured out yet is how to make this run everytime I start Adium. I have only managed to attach it to in-chat trigger words (like "/snapshot"). Or how to make this take a snapshot a timed interval. If you have any hints, then please leave a comment.Update: Finally got it working!