Applescript 1708 error

Discussion in 'Mac Programming' started by ilostmywaytobed, Feb 25, 2010.

  1. ilostmywaytobed macrumors newbie

    Feb 25, 2010
    hey everyone,

    I just started learning applescript yesterday, so bear with me.

    I wanted to write a script for iChat which opens an IM window every time a specific buddy signs on.

    Here is my script:

    tell application "iChat"
    if (buddy became available "hetu1989") then
    show chat chooser for "hetu1989"
    end if
    end tell

    When my screen name "hetu1989" signs on, my iChat gives me the following error:


    I tried to find out how to get rid of this error, and I saw that some pople had also encountered it, but those threads didn't help me much. So, any help will be appreciated.
    Thanks a lot!
  2. fredthefool macrumors newbie

    Jun 4, 2008
    I don't use iChat, so i'm probably terribly misled ...

    Just a shoot from the hip, but as "buddy became available" is an Event, try to catch that with

    tell application "iChat"
      on buddy became available "hetu1989"
        show chat chooser for "hetu1989" 
      end buddy became availabe
    end tell
    The -1708 error shows that an Event wasn't handled by an Event Handler. For the "buddy became available" is the only Event in your script, this could be the trap ...
    And as for the "chat chooser" being a dialog, it could help to activate the iChat App before.
  3. chown33 macrumors 604

    Aug 9, 2009
    Sailing beyond the sunset
  4. ilostmywaytobed thread starter macrumors newbie

    Feb 25, 2010
    ahh, i figured it out.

    set hetu1989 to buddy(AIM, hetu1989)
    using terms from application "iChat"
    	on buddy became available hetu1989
    		show chat chooser for hetu1989
    	end buddy became available
    end using terms from
    using terms from application "iChat"
    	on buddy became unavailable
    		close (show chat chooser hetu1989)
    	end buddy became unavailable
    end using terms from
    By the way, is there anyway to make it accept the chat chooser automatically?

    thanks for the help everyone.

Share This Page