Hi guys - my first post…
I’m trying to make an Applescript to notify me by email when a particular contact comes online in Adium. My first attempt seemed to work OK when run in Script Editor, but when I set it as the applescript to run when a contact signs on in the Events prefs in Adium, it never got run. Here’s the code:
set contactname to "daniel"
set emailAddress to "me@myhouse.com"
set theSubject to contactname & " is online"
set foundContact to false
tell application "Adium"
repeat with aContact in contacts
if the UID of aContact contains contactname or display name of aContact contains contactname then
set foundContact to true
end if
end repeat
end tell
if foundContact is true then
tell application "Microsoft Entourage"
set newMsg to make new draft window with properties ¬
{recipient:{address:emailAddress, recipient type:to recipient}, subject:theSubject, content:theSubject}
send newMsg
end tell
end if
I tried making it a seperate application using on idle but this seems to notify me every 10 seconds regardles of whether the specified user is online or not.
Can anyone suggest a better approach or what the problem might be with the script? The Adium Applescript dictionary didnt seem to have anything for event management…
cheers