iChat handlers

Hello,

In reference to the discussion http://bbs.macscripter.net/viewtopic.php?id=26938 ,

someone asked me about detecting when a chat has closed in iChat and then having iChat quit.

iChat’s dictionary has a handler for just about everything, and I found one for closing a chat. Here’s my code:

using terms from application "iChat"
	on av chat ended theObject
		tell application "iChat" to quit
	end av chat ended
end using terms from

I made the script Stay Open and had it running, then closed an iChat script. Nothing happened. I don’t see a way to trace it because it has to be running.

Has anyone done this? Thanks.

this works on my machine


using terms from application "iChat"
	on av chat ended
		quit application "iChat"
	end av chat ended
end using terms from

There is no stay open script required,
just make sure, that iChat responds to the event handler, connect the script to Alerts > A/V Chat Ended > Run AppleScript in the Preferences

D’oh! I was not aware that the Preferences had those connections.

I need a handler for when a text chat ends though. The AV chat ends handler doesn’t handle that event.