My app changes statuses in iChat according to the user's hot keys, using AppleScript. Everything goes okay, but in the case when iChat isn't running, I have a "iChatAgent" running, with its icon in the status bar; there's no icon of iChat in my Dock.
So in this case if my app sends an AppleScript command to change an iChat status (tell application "iChat" set status blah-blah...
), it automatically activates iChat and an icon of iChat appears in Dock. I do not want to activate iChat. I do not need any changes in my Dock. But I need to change status of iChat when it isn't running.
How can I do this by my application to iChatAgent to change the status? is it possible at all?
iChatAgent is the background messaging application used by iChat 5 when iChat proper is not running. On Snow Leopard with FaceTime installed, and on Lion, it has been superseded by IMAgent (/System/Library/PrivateFrameworks/IMCore.framework/imagent.app/
– see this Apple Support Communities discussion thread for corroboration).
The agents are not AppleScript-able, which you can check by yourself by trying to add one to the AppleScript Editor dictionary panel: you will get an error indicating the application is not scriptable. This means scripts can only target iChat itself and, by extension, that you cannot bypass the application launching when you do (this also applies to script plugins in iChat – they are only triggered when the application is running).
TL;DR: you cannot set iChat status via AppleScript without launching iChat.app