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.
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.
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.