• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
RE: run script ... with parameters
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Wrapping lines
  • Next by Date: Re: Dynamic Records?? (or other alternatives)
  • Previous by thread: Re: Wrapping lines
  • Next by thread: Quark: copying across text boxes
  • Index(es):
    • Date
    • Thread