Talking to iChat
The InstantMessaging framework in 10.4 is useful for getting a list of all of your buddies and getting their email address, picture, or capabilities etc, but how can you send a file to a buddy? What about getting a list of the groups a buddy is in, or even simply creating a new chat window? The IM framework doesn’t do these things. You can do some of these through Applescript of course, but I’d rather gag on the proverbial fork.
So what can you do? Well, after poking around for a short while, I figured out (it’s not that hard) there’s a connection between iChat and another program called iChatAgent. iChat controls most everything dealing with service connections, buddies, and all of that by telling iChatAgent to do it. The iChat status menu item is separate from iChat.app and talks to iChatAgent also. This is why iChat.app doesn’t have to be open and you can still be connected to AIM or Jabber or whatnot. So how can you talk to iChatAgent directly? You do so by creating a connection to it using NSConnection.







Comments(0)