iChat - script fix

Hey,

Now that this is in the right forum :stuck_out_tongue:

I tried using this script:

property was_online : {}
property watch_list : {}

set was_online to check_ichat()
set watch_list to {"important buddy"}

on idle
	set is_online to check_ichat()
	repeat with x in is_online
		copy contents of x to y
		ignoring case, expansion and white space
			if y is not in was_online and y is in watch_list then display dialog y & " is now online!"
		end ignoring
	end repeat
	set was_online to is_online
	return 10
end idle
to check_ichat()
	tell application "iChatAgent" to name of accounts of service 1 whose status 1 is not offline
end check_ichat

That has been changed from the orginal script that was given to me from a member on these boards; however, when I try to compile it and then run it, it says I must define ā€œaccountsā€, ā€œserviceā€, ā€œstatusā€, and ā€œofflineā€ and that I canā€™t have ā€œ1ā€ after serviceā€¦what exactly can be done to fix this?

iChatAgent isnā€™t a scriptable application. Switch it back to iChat. iChat must be open for my script to work.

Edit: looks like an extra ā€˜1ā€™ cropped up after ā€˜statusā€™ too. For reference, here is the original script.