Re: Run script with parameters?
Re: Run script with parameters?
- Subject: Re: Run script with parameters?
- From: Harald E Brandt <email@hidden>
- Date: Tue, 24 Apr 2001 23:44:52 +0200
+--> Jeffrey W Baumann wrote 01-04-24:
>
On Monday, April 23, 2001, at 04:34 PM, Harald E Brandt wrote:
>
>
>I can't get this to work:
>
>
>
> run script alias "HD:test" with parameters {2, 3}
>
>
>
>With the script file called "test" being:
>
>
>
> on test(a, b)
>
> display dialog (a + b)
>
> end test
>
>
>
>Why doesn't this work?
>
>Isn't run script supposed to be able to run such a thing?
>
>
>
>I run AppleScript 1.6 on Mac OS 9.1 US
>
>
>
>With hope for help,
>
>
Script file "test" may be "running," but there's nothing in its run handler. You want to call one of its handlers.
>
>
try this:
>
>
set testScript to load script file "HD:test" -- I personally dislike using "alias"
>
tell testScript
>
test(2,3)
>
end tell
+-
I am already aware of the 'load script' version to load libraries.
I wanted something shorter and more direct, and thought 'run script' would be just what I wanted, namely to run a single procedure I have stored in a file.
Obviously I don't understand it. How can I achieve the same result (as 'load script' plus a tell) with 'run script'? What do you mean by saying that there's nothing in its run handler? Why aren't the numbers 2 and 3 passed to the run handler 'test'? How else are parameters supposed to be handed to a script?
With the Best and curious Regards,
______heb________________________________________________________________
Harald E Brandt email@hidden PGP/MIME aware
http://heb.surf.to