• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Script Applet rejects first handler call
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Script Applet rejects first handler call


  • Subject: Script Applet rejects first handler call
  • From: email@hidden
  • Date: Tue, 31 Jul 2001 11:29:43 -0400

Here's something annoying: When I call a handler in a script applet from
another script, I get an error on the first call.

-- "Test": saved as a stay-open Classic applet
on run
say "Run"
end run

on h()
say "Handler"
end h

I save that script, and call it with this one:

tell application "Test"
h()
end tell

If "Test" is running, everything works as expected. But if it isn't, I get the
error "Can't continue h". The error number is -1708 (errAEEventNotHandled).

This is under OS 9.1 with CarbonLib 1.3.1, AppleScript 1.6, and Script Editor
1.6. It also occurs if the scripts are compiled with Smile or with Script
Editor 1.1.3. It doesn't occur if I boot into OS 8.6 and AppleScript 1.

I understand that I can avoid the error by precautionarily telling the server
script to run before invoking any of its handlers, but that's not the way
AppleScript is supposed to work. Also, I have some scripts that are called from
ListSTAR, and these can not be guarded with a "run", since ListSTAR doesn't have
a script itself, it just sends <<event s9evts9Lis>> events at the scripts.

Any thoughts on how to restore the normal behavior? Barring that, does anyone
know which version of AppleScript I should revert to to regain the old behavior?
--
Scott Norton Phone: +1-703-299-1656
DTI Associates, Inc. Fax: +1-703-706-0476
2920 South Glebe Road Internet: email@hidden
Arlington, VA 22206-2768 or email@hidden


  • Follow-Ups:
    • Re: Script Applet rejects first handler call
      • From: Paul Skinner <email@hidden>
  • Prev by Date: Getting front app
  • Next by Date: Read/Write 'as short' and 'write "" starting at'
  • Previous by thread: Re: Getting front app
  • Next by thread: Re: Script Applet rejects first handler call
  • Index(es):
    • Date
    • Thread