Adium notification when contact comes online

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

Hi pr0fess0r,

I’m sorry, I’m not really in a position to answer your question as I do not use Adium or Entourage. However I had a look at the Adium website and they say:

(see http://trac.adiumx.com/wiki/AppleScript)

Perhaps you have come across one of these bugs?

Best wishes

John M