-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAdiumAction.scpt
29 lines (25 loc) · 1.13 KB
/
AdiumAction.scpt
1
-- Copyright Google Inc. 2011. All rights reserved.-- Author: [email protected] (Peter Schmitt)-- Opens an Adium chat with the contact that has the provided contact name.-- Opens a chat with the first contact in Adium that (prefix) matches the passed string.-- If a chat for the user already exists, focuses that window & tab.-- If no chat window exists opens a new chat window. Otherwise opens a new tab.on open_chat(contact_name) tell application "Adium" set user to first contact whose (display name starts with contact_name) if not (exists (user)) then set user to first contact whose (name starts with contact_name) end if if not (exists (chats whose contacts contains user)) then if not (exists (first chat window)) then tell account of user to (make new chat with contacts {user} with new chat window) else set existing_window to first chat window set existing_chat to last chat in existing_window tell account of user to (make new chat with contacts {user} in window existing_window) end if end if tell (first chat whose contacts contains user) to become active activate end tell end open_chat