Panther script returns incomplete info on iChat accounts

(on panther 10.3.2 updated current)

so polling iChat with a script such as:

tell application "iChat"
	set bla to every account of every service
	return bla
end tell

returns:
{{application “iChat”, application “iChat”, application “iChat”, application “iChat”, application “iChat”, application “iChat”, application “iChat”, application “iChat”, application “iChat”, application “iChat”, application “iChat”, application “iChat”, application “iChat”, application “iChat”, application “iChat”, application “iChat”, application “iChat”}, {application “iChat”}}

which is incomplete information of the account objects handled by iChat. (you can do a similar type of thing with Mail and it will return lists like {account “loki-test” of application “Mail”, account “cataphora” of application “Mail”} - which is correct)

this wouldn’t be so bad if it was a simple object → string conversion error and i was still getting back fully functioning objects. however, if i do:

tell application "iChat"
	set foundWalkor to "no"
	set bla to every account of service "AIM"
	repeat with ugh in bla
		if (name of ugh is "walkor") then
			set foundWalkor to "yes"
		end if
	end repeat
	return foundWalkor
end tell

i get “no”, but running:

tell application "iChat"
	set foundWalkor to "no"
	set killme to (name of every account of service "AIM")
	if ("walkor" is in killme) then
		set foundWalkor to "yes"
	end if
	return foundWalkor
end tell

which returns “yes” and therefore, i believe, points to iChat correctly internally processing the applescript but returning broken objects…

anyone else able to verify this / know of a solution / know if apple knows of this / … etc?

thanks,
loki

Is this what you’re looking for?

set account_name to "walkor"
tell application "iChat"
	try
		set the_account to (a reference to account account_name)
		set the_props to properties of the_account
	on error
		return false
	end try
end tell

return {the_account, the_props}

Jon

nah - i wanted to use the command “send” which takes the optional argument of an instance of account – (which iChat isn’t about to give back to me)… i can make it work by glomming it all together in single command like below – just incensed that iChat isn’t working correctly while other apps (like Mail) are…

tell application “iChat”
send “this sucks” to (every account where name is “walkor”)
end tell

thanks for your feedback, loki

Does this work?

tell application "iChat"
	activate
	set the_accounts to (id of (a reference to (accounts whose name contains "walkor")))
	repeat with this_account in the_accounts
		send "this sucks" to (a reference to account id (contents of this_account))
	end repeat
end tell

Jon

ya - that seems to work as well – again, there’s work arounds like your example and like my example… i was just trying to verify that iChat was not handing back object instances correctly – it does fine handing back single (or lists of) property values fine, but it appears that the objects are broken (unless you (or someone) has an example of the script handing back an object that it’s supposed to (like my original example where it should have handed back account objects))

thanks.
loki