is there a way to get incoming messages on ichat?

I am trying to get the incoming text that a buddy sends me in ichat. Just like when you say “get account names”. Is there a way to get the message they sent you. I need to turn it into a variable, but i cant access it.

I was going for something like this, but it does not do a thing…

tell application "iChat"
	get contents of window "chat with chandler"
end tell