Is this a difficult thing to do? or is no one looking?

I'm also wondering this, i've tried this code, but it's not working:
set allchats to every chat
set found to false
repeat with onechat in allchats
if (id of contact of onechat as string) is (id of contact "
contact@gmail.com" as string) then
tell chat window of onechat to activate onechat
activate chat window of onechat
display dialog "Tried to activate the window"
set found to true
end if
end repeat
The dialog displays, but for some reason the chat window isn't the one that's active. I'm trying to both get the window that has the contact to be active and also to get the contact to be the active chat of the window.