how to read dictionaries? [Adium]

Hi… Am I the only one who finds AS dictionaries a little confusing?

I am trying to experiment with setting the status type in Adium to Away or Available for a specific account…

in the dictionary it has a list object which says:

So I can say:

tell application "Adium"	
	return status type of account 2	
end tell

and I get “away”

but if I do:

set status type of account 2 to available

I get an NSInternalScriptError… I assume because the dictionary says “R/O”…

Ok… but then the dictionary has a “status” page… It says:

and further down simply says:

So this leads me to believe it is possible to set the status of an account… Apparently not with “status type” but with “type” – being related to status… or something…

I have tried:

tell application "Adium"
	tell status of account 2
		set type to available
	end tell
end tell

then I get:

So… I am wondering… what is the proper way to set this?

thank you.
-patrick

here is my latest attempt… which is also not working…

tell application "Adium"
	repeat with the_account in every account
		if UID of the_account = "blabla@hotmail.com" then exit repeat
	end repeat
	tell statuses of the_account
		set type to away
	end tell
end tell

Patrick, I’m pretty sure the “r/o” means read-only… meaning you can only read it… meaning you can’t set it.

Hi Patrick,

I don’t have Adium, but this might help. Sometimes a property is read only, but you can set an object’s property when the object is made.

gl,

That dictionary looks… :confused:

Sorry, I can’t add anything helpful right now.

Yeah… I spent too many hours looking at it today, and decided it was impossible… You can easily set a global “status” for all accounts, but individual ones apparently are not possible…

If anyone in the future wants my script of what “does work”, here it is:

tell application "Adium"
	activate
	set button_result to button returned of (display dialog "What do you want?" buttons {"away", "invisible", "available"})
	if button_result = "away" then
		set my status message to "I be away!!!"
		set my status type to away
	else if button_result = "available" then
		set my status message to "I be here!!!"
		set my status type to available
	else if button_result = "invisible" then
		set my status message to "I be a ghost!!!"
		set my status type to invisible
	end if
end tell

(*
-- this is what didn't work:

tell application "Adium"
	activate
	set all_accounts to every account
	repeat with the_account in every account
		if UID of the_account = "blabla@hotmail.com" then
			tell the_account
				set properties to {status type:away}
			end tell
			return properties of the_account -- You can see all these damn properties, but can't write them!!!!!! arrg.
		end if
	end repeat
end tell
*)