Re: Script Applet rejects first handler call
Re: Script Applet rejects first handler call
- Subject: Re: Script Applet rejects first handler call
- From: Paul Skinner <email@hidden>
- Date: Wed, 01 Aug 2001 10:33:58 -0400
on 8/1/01 7:52 AM, Marc K. Myers wrote:
>
> 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>
Mark,
I think there might be some confusion in terminology at work here. The
'script server' mentioned in this thread is actually a stay-open script
running ( or not as the case may be ; ) on the same box as the script that
accesses it's handlers. One could set up a script server on a network box
and access it from multiple machines, but that's another kettle of fish.
--
"AppleScript is digital duct tape."
Paul Skinner