Using Applescript (or anything) to open a chat window
Posted: Wed Jan 06, 2010 6:20 pm
I'm having troubles creating an applescript to open a chat window to a specific person.
I'm trying to write a small script that I can pass a display name or email and it will open a chat window to that person and make it active. I don't care if it makes a new window or not. I'd like it to be account inspecific if possible.
Here's my current code (feel free to recommend completely new code though, this is my first applescript attempt).
tell application "Adium"
if exists contact "contact@gmail.com" or exists contact whose display name is "contact@gmail.com" then
set mycontact = contact "contact@gmail.com" or contact whose display name is "contact@gmail.com" (this errors out here)
tell account of mycontact to set chatWindow to make new chat with contacts {mycontact} with new chat window
activate chatWindow
end if
end tell
I'd also like it to just activate the chat window of the person if it already exists.
I'm trying to write a small script that I can pass a display name or email and it will open a chat window to that person and make it active. I don't care if it makes a new window or not. I'd like it to be account inspecific if possible.
Here's my current code (feel free to recommend completely new code though, this is my first applescript attempt).
tell application "Adium"
if exists contact "contact@gmail.com" or exists contact whose display name is "contact@gmail.com" then
set mycontact = contact "contact@gmail.com" or contact whose display name is "contact@gmail.com" (this errors out here)
tell account of mycontact to set chatWindow to make new chat with contacts {mycontact} with new chat window
activate chatWindow
end if
end tell
I'd also like it to just activate the chat window of the person if it already exists.