ichat window text

How would i go about setting the text in an ichat chat window as a string in a variable?

thanks!

Hi,

I’m not sure whether you mean an incoming or outgoing text.
Assuming incoming text you can use the message received event handler


using terms from application "iChat"
	on message received theMessage from theBuddy for theChat
		-- do something with theMessage
	end message received
end using terms from

connect the script to the Message Received Event in the Alert Panel of Preferences

perfect thanks!

ok im at another problem.

this is what i have set as the message received applescript in the preferences.



using terms from application "iChat"
	on message received theMessage from theBuddy for theChat
		if theMessage = ("Set alarm") then
			tell application "Clock"
				activate
			end tell
		else
			if theMessage = ("Awake") then
				tell application "iTunes"
					quit
				end tell
			end if
		end if
	end message received
end using terms from
end


What its doing is when ichat receives “Set alarm” it opens my alarm app i made and sets it. and when it receives “Awake” it quits my alarm(which uses itunes).

But everytime i run it, it works but ichat freezes. Can ichat not do this? And if not is there another way to get these results?
thanks