RE: run script ... with parameters
RE: run script ... with parameters
- Subject: RE: run script ... with parameters
- From: Olof Hellman <email@hidden>
- Date: Tue, 4 Dec 2001 12:26:17 -0800
Paul asks ( re: run script with parameters ):
>
How does that work? What do 'parameters' of 'run script' do, and what sort
>
of things are legal, or effective, parameters?
If you write a run handler with arguments:
on run (a, b)
...
end run
you call it like this:
run ( 2, 3 )
But if you use the 'run script' scripting addition, you have to do this:
script Fred
on run (a, b)
...
end run
end script
run script Fred with parameters { 2, 3}
Note that AppleScript is a little flakey when checking for parameter
matching:
run script Fred with parameters { 2, 3, 4}
--> works fine
run script Fred with parameters { 2}
--> error
Apparently supplying too many parameters is OK, but too few is not allowed,
even if the parameters are not used.
- Olof