Applescript: how to change active chat?

An instant messenger which can connect to AIM, GTalk, Jabber, ICQ, and more.
Post Reply
aristide
Harmless
Posts: 1
Joined: Fri Oct 02, 2009 1:10 pm

Applescript: how to change active chat?

Post by aristide »

I'm writing some little scripts to allow disabled people to command Adium from within my own application.
It's quite easy to send a message to the frontmost chat:

Code: Select all

on run argv
	tell application "Adium" to send active chat message argv
end run
But, how to make active another chat? Is it even possible?
The application's property active chat is read-only, and making a new chat doesn't switch to it if it already exists.
Thanks!
silkcom
Harmless
Posts: 3
Joined: Wed Jan 06, 2010 6:10 pm

Re: Applescript: how to change active chat?

Post by silkcom »

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.
Post Reply