Here’s a quick-and-easy OS X 10.5 iChat tip (with a bonus OS X 10.4 variant thrown in, along with a little iTunes/iChat tip) for your Thursday morning. iChat, being the good citizen that it is, pops up a dialog box whenever someone initiates a chat with you; you can use the dialog to accept or reject the chat request. But what if your’e a sociable sort, and you always accept your chat invitations? In that case, the dialog box is nothing but a waste of time and energy that you’d rather do without. But how can you get rid of it without actually clicking on the accept button each time?
In Tiger, you could do this by installing Chax, an iChat enhancer. As of now, however, Chax won’t work in Leopard. (An update is forthcoming.) Chax also adds a number of other features, most notably tabs for Tiger iChat users, and it’s something I used regularly in OS X 10.4.
In Leopard, however, Apple built in support for tabs, as well as double-clicking pasted images to open them in Preview, so I haven’t been missing Chax—except for its auto-accept chat invitations feature. In digging around in OS X 10.5’s iChat, though, I found that there’s a new Run AppleScript option in the Alerts section of iChat’s preferences. Since the dialog box displays standardized buttons, I thought I might be able to write an AppleScript to simulate pressing the Accept button.
However, I found a surprise when I clicked the Run AppleScript button: Apple’s already done the hard work for us! It included three scripts—one for auto-connect, one for auto-decline, and one to work as an iTunes controller:
So for each type of chat (Event is text, audio, or video invitation) that you’d like to auto-accept, enable the Run AppleScript checkbox, and point it to the auto-accept AppleScript. If you’d like to see the source for these scripts, you’ll find them in the top-level Library -> Scripts -> iChat folder. If you want to write and use your own scripts, you can create the same directory structure (Scripts -> iChat) in your user’s Library folder, and iChat will find them there.
And yes, that’s really an iTunes controller AppleScript. If you’ve got more than one Mac in the house, set up iChat to use Bonjour messaging (in Preferences -> Accounts), and set the iTunes-owning Mac to run that AppleScript when a new message is received. You can then send the iTunes-owning Mac these commands as chat messages from another Mac: status, next, previous, mute, unmute, help, play, and pause. Just type each one on a line of its own and press Return; the iTunes Controller AppleScript on the other end will then tell iTunes what to do.