Re: Script Applet rejects first handler call
Re: Script Applet rejects first handler call
- Subject: Re: Script Applet rejects first handler call
- From: "Marc K. Myers" <email@hidden>
- Date: Wed, 01 Aug 2001 07:52:51 -0400
- Organization: [very little]
>
Date: Tue, 31 Jul 2001 11:29:43 -0400
>
From: email@hidden
>
Subject: Script Applet rejects first handler call
>
To: email@hidden
>
>
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 se rver
>
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?
Does this work for you? It works locally but I don't have a server to
test it on.
tell application "Test"
launch
h()
end tell
Marc K. Myers <email@hidden>
http://AppleScriptsToGo.com
4020 W.220th St.
Fairview Park, OH 44126
(440) 331-1074
[8/1/01 7:52:14 AM]