• 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
lecture on: on 'on open', 'on run' and other functions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

lecture on: on 'on open', 'on run' and other functions


  • Subject: lecture on: on 'on open', 'on run' and other functions
  • From: email@hidden
  • Date: Wed, 22 Nov 2000 20:45:59 EST

good morning everybody! happy thanksgiving!

just some info on 'on open', 'on run', and some other stuff

all scripts (not including folder actions) use either 'on run' or 'on open'
or both
usually, they only have 'on run' and you need not type 'on run' if that is
the case
'on open' is what happens when either you drop a file or files on it or
double click on a file of the application **(for more info on this email me,
i cant explin it now)**
'on run' defines what happens when the icon is double-clicked.
global variables are 'declared' at the top of a script and tell the computer
that they may be used in any function. otherwise they can only be used in one.
you may also have other functions that can help organize your program. here
is an example:

global x,y
on open thefiles
repeat with afile in thefiles
doopenstuff(afile)
end repeat
end open
on run
set {x,y} to {3,2}
dorunstuff()
end run
on dorunstuff()
display dialog "x="&x&" and y="&y
end dorunstuff
on doopenstuff(somefile)
display dialog somefile as text
end doopenstuff


  • Prev by Date: Re: Incremental Character Generator
  • Next by Date: Brain Cramp
  • Previous by thread: Re: Word file to Quark file
  • Next by thread: RE: limiting decimal places...
  • Index(es):
    • Date
    • Thread