Re: Curious problem with Scripter
Re: Curious problem with Scripter
- Subject: Re: Curious problem with Scripter
- From: Max Bonilla <email@hidden>
- Date: Thu, 26 Apr 2001 11:15:20 -0500
Richard,
I'm not sure that the path to me discussion is supposed to help solve
the problem, right? But I think what you are suggesting is that I
should try Script Editor when I find unusual behavior. I think that
is what you are saying, as you avoid being raked over the coals. . . !
Thanks!
Max
>While working on a script using Scripter PE I found that if I use the
auto-step feature, or if I invoke the script from the application
(Eudora), I get an error (variable errMessage not defined). So to
find where I left such variable undefined, I use the step feature of
Scripter, carefully pressing the shift key to be sure I step into any
handler that is used by the script. The funny thing is that I can
run the whole script that way and I never have a problem. So if I
run it very slowly, step by step, the variable is defined, but if I
go quickly with the auto-step the variable is not defined. How can
that be?
I've already been raked over the coals for suggesting anything might
be wrong with or improved in Scripter so I won't go there... 8)
** CAUTION: EDITORIALIZING **
If you are offended by personal opinion, close your eyes and move on.
My answer would go something like this:
Because debugging AppleScript is basically a hack which may or may not
function like a script in the real world, eg, an applet shell, or
being run by an application using OSA. Much of the time, for simple
by-the-numbers scripting this is fine.
<SNIP>
Let's just say that although sometimes quite useful, I have found
enough little inconsistencies in the "advanced" script editors to
stick close to Script Editor, warts and all. It seems to run scripts
closest to how they will perform in the wild, other than the annoying
"path to me" feature, one of my personal pet peeves.
Script Debugger does do path to me nearly right (if you set the
preferences to return path to document). One caveat relying upon
this: path to x normally returns an alias while SD returns a file
specification. It seems to be implementing a command handler which
doesn't include the optional "as" parameter. The result?
<SNIP>