Re: Possible bug.
Re: Possible bug.
- Subject: Re: Possible bug.
- From: Paul Berkowitz <email@hidden>
- Date: Tue, 04 May 2004 09:54:49 -0700
On 5/4/04 6:22 AM, "Deivy Petrescu" <email@hidden> wrote:
>
At 8:48 AM -0700 5/3/04, Paul Berkowitz wrote:
>
>> According to AS "run script: Run a specified
>
>> script or script file". Well, 2^3+1 is a script
>
>> according to my Script Editor, thus it is fair
>
>> game for run script script.
>
>
>
> Yes, but you have to put it into quotes first in order to 'run script': that
>
> makes it 'text' - one of the two formats allowed/
>
>
Paul, you do not have to put it into quotes to make it run.
>
run script 5^4+2
>
compiles and runs fine.
Deivy,
I'm going to quit now. You have not understood one thing I've been saying
the whole time. I'll repeat it one more time, then I'll quit and will not be
returning to this topic.
'run script' takes TEXT (a string) or a script file (alias), according to
the dictionary. Yes, it will take a number, even though the dictionary
doesn't say so, due to an IMPLICIT COERCION. But it does not promise to, so
it's entirely your risk if you choose to use it. If you stick to what's
promised in the dictionary you will not have a problem. Now, Chris says that
the reason you're getting a problem is NOT because the implicit coercion is
erratic but rather because there's a bug in the parser. Fine. Nevertheless,
if you stick to the definition in the dictionary, you will not have a
problem here.
>
>
>
> Here's another script that runs fine in Script Editor:
>
>
>
> path to desktop
>
>
>
>
>
> Now try
>
>
>
> run script (path to desktop)
>
> --> ERROR: Scripting component error
>
>
>
> Now try
>
>
>
> run script "path to desktop"
>
> --> alias "PB G5 HD Panther:Users:berkowit:Desktop:"
>
>
I believe this is because of the way run script runs.
Nonsense.
>
>
>
>
> It needs a string. Just give it a string.
>
>
>
>
the string makes it less of a problem when compiling and running.
>
however:
>
>
run script (say "hello world!)
>
>
compiles,runs and then errors at the end. (but runs!)
>
So does:
>
>
run script (display dialog "hello world").
>
>
Same thing, errors at the end but runs.
>
>
I honestly believe the commands run twice. The
>
run script and then the command itself.
>
If you sent text this does not happens.
Nonsense. AppleScript evaluates terms within parentheses before carrying
out the commands around them. In both these two cases the commands within
parentheses create UI artifacts on the screen, so yes, you see them when
they're evaluated first. All that means is that 'display dialog' and 'say'
are functioning. It does NOT mean that 'run script' is running - because
it's NOT running - it errors. In the case I gave (path to desktop) also
works - you don't see anything on the screen because there's nothing to see.
And 'run script' errors, just the same as with 'say' and 'display dialog'
not being strings.
>
>
>
>
>
>
>>
>
>> Also, I believe anything that behaves
>
>> inconsistently and can throw a scripter off is a
>
>> bug.
>
>
>
> Well, that's an interesting definition. Some people are thrown off by all
>
> sorts of things in AppleScript, including
>
>
>
> set x to 5
>
>
:)
>
>
I see you narrow your definition of text, but
>
expands greatly the definition of throw off.
>
>
>>
>
>
>
>
>>
>
>> I do not know if the list is in favor of this or
>
>> not, but my personal opinion is anything that
>
>> behaves in an inconsistent manner should be
>
>> pointed out to the list as a bug, whether
>
>> bonified or not by the Apple and the AS team.
>
>> We can document it by ourselves.
>
>
>
> Sure. If Apple had not yet known about the parser bug, analyzing this
>
> problem would have led them to find it, if they know that
>
> number-to-string-coercion should always work in a 'run script' context. So
>
> it's always good to report these things. Nevertheless, in a practical sense,
>
> they have documented 'run script' to work with text and with script files,
>
> and if you give it what it asks for, there's no bug with 'run script'.
>
>
>
>
>
> --
>
> Paul Berkowitz
>
>
>
>
Good, at least we are agreeing in something else
>
(I agreed with you that long decimals was causing
>
the problem)!
>
By the way, we also agree that sending text clears all problems.
Good to hear. That's what you're supposed to do.
--
Paul Berkowitz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.