Vincent Gable’s Blog

January 18, 2009

iChat AppleScript / Apple Event Gotcha With “set status”

Filed under: Bug Bite,MacOSX,Programming | , ,
― Vincent Gable on January 18, 2009

If you run the AppleScript:


tell application "iChat"
   set status message to "testing"
   set status to away
end tell

You might expect to have the away message “testing”. But what you get is an empty away message. That’s because set status destroys your status message. It behaves as if you had selected “Away”, “Available”, etc. as your status from iChat’s status menu.

If you want to set a custom away message, call set status first, so it won’t over-write your message.


tell application "iChat"
   set status to away
   set status message to "testing"
end tell

Filled as radar://6505882, but Apple considers it expected behavior.

3 Comments »

  1. With the current version of iChat under OS 10.6.6, I can’t get the workaround to work.
    This fails to do both, and I only get the message, without the status changing:


    tell application "iChat"
    set status to away
    set status message to "Do Not Disturb"
    end tell

    However this works:

    tell application "iChat"
    set status to away
    end tell

    and this works:

    tell application "iChat"
    set status message to "Do Not Disturb"
    end tell

    Comment by Lantrix — January 16, 2011 @ 7:03 am

  2. I’m afraid I have no suggestions, except reporting it at: http://bugreport.apple.com. Good luck!

    Comment by Vincent Gable — January 16, 2011 @ 7:52 am

  3. Try to call sleep function between setting status and status message:
    tell application “iChat”
    set status to away
    do shell script “sleep 0.1”
    set status message to “Away”
    end tell
    That helps me.

    Comment by Kentzo — February 3, 2011 @ 2:20 pm

RSS feed for comments on this post.

Leave a comment

Powered by WordPress