• 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: Ted Wood <email@hidden>
  • Date: Tue, 24 Apr 2001 22:29:53 -0700

For those new to AppleScripting, here's some information about the 'invisible' Run handler...

The 'Run' handler is always there in a script. It encloses all root level commands typed into a script or script object. For example, if my entire script were to consist of the following commands...

beep
display dialog "Hi there!"

AppleScript would see this...

on run()
beep
display dialog "Hi there!"
end run

Similarly, in script objects, such as this...

script myScript
beep
display dialog "Hi there!"
end script

'beep' and 'display dialog' are at the root level of that script object, so AppleScript would see this when the script object was invoked...

script myScript
on run()
beep
display dialog "Hi there!"
end run
end script

Now, you can control this behavior if you need to call the Run handler from within a script or pass it parameters by enclosing *all* root level commands within a 'visible' Run handler, as you'd declare any other handler.

Hope that helps to clarify a few things.

Ted


References: 
 >Re: Run script with parameters? (From: Sun Real <email@hidden>)

  • Prev by Date: Re: Keyboard functions
  • Next by Date: help with date&time
  • Previous by thread: Re: Run script with parameters?
  • Next by thread: Re: Run script with parameters?
  • Index(es):
    • Date
    • Thread