Set iChatAV Status

Hi folks.

I thought this would be really easy, but I guess it’s over my AppleScript-newbie head.

I just want to make a script that will change the status to “Available” and another one that will change it to “Away”. This is going to be initiated by a FileMaker database that currently tracks my staff’s in/out status (I want the two systems integrated). So it has to work with any account, and it should probably be enveloped in a “Try” command because it’s not critical that it work, and shouldn’t produce any error messages.

So I tried this:


try
	tell application "iChat"
		tell accounts
			set status to away
		end tell
	end tell
end try

and this


try
	tell application "iChat"
		tell accounts
			set status to "Away"
		end tell
	end tell
end try

Well, neither one works. If I take out the Try, I get an NSInternalScript Error. It reported:
tell application “iChat”
set status of every account to away
“iChat got an error: NSInternalScriptError”

Any ideas what I’m doing wrong? I want the status to change, but iChat to stay logged in. I’d also like it if I could set a “Lunch” status, which would be a custom “Away” status message.

Thanks!

Anyone have any ideas? I figure there’s a really simple thing I’m overlooking…

TIA!
:smiley:

I have iChat 1.0.1 on OS X 10.2.8 and it isn’t scriptable.

– Rob

Yeah, one of the “features” of iChat AV (included with 10.3) is AppleScriptability. Was not an option prior to AV and/or 10.3.

Thanks for trying, though!

I have iChat 2.0 in Jag 10.2.8 and it has a scripting library.

I think AV and 2.0 are the same thing.

I have iChat 2.0 (jaguar) and the following works for me:

tell application "iChat"
		set status message to "Whatever"
end tell

– Ross

I tried that, and it kinda worked, but only half-way.

It changes the Status message, but not the actual status. So If I use “Away” for example, it changes the message to Away, but the light next to my name is still green, indicating that my status is “available.”

I tried this instead:

tell application "iChat"
	set status to "Away"
end tell

but that script seems to merely toggle my connection. No matter what I have in the quotes, it logs me out entirely if I am on, and logs me in if I am logged out.

What gives? (And why is this so hard?)

All I want is a script that will have the same effect as choosing the “Away” or “Available” options in my iChat popup menu.

Any more suggestions would be very welcome!!

Thanks!

You will have success if you take off the quotes around away/available/offline. It is not expecting a string, but instead away/available/offline are iChat constants.


Ross

Thanks dude… that did it.

So the end code is, for example:

tell application "iChat"
	set status to available
	set status message to "Available"
end tell

You can also do custom messages like:

tell application "iChat"
	set status to away
	set status message to "At Lunch"
end tell

Thanks all!

is there a way to monitor a budy’s status? all of the budies’ statuses?

thanks