• 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: Script Libraries
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Script Libraries


  • Subject: Re: Script Libraries
  • From: Simon Forster <email@hidden>
  • Date: Wed, 10 Nov 2004 09:56:19 +0000


On 9 Nov 2004, at 21:52, has wrote:

As there is _some_ coupling (<--new word usage from Simon!!) between functions, the coupled functions reference the global variables containing the script libraries. The only alternative is to pass the library(s) as arguments to each of the functions.

No, you can put libraries into properties in the script that uses them and reference them there. This is what the AppleMods libraries do; they've already solved these problems. Trust me, I've been through all this stuff myself, including the same (mis)use of globals in my earliest attempts at modular design.

OK. Got there eventually. Thank you for your patience and sharing of knowledge - much appreciated.


FWIW, I went back and reviewed the AppleScript language guide and what it had to say about Properties. My previous reading had led me to believe that Properties and Globals were pretty much equivalent with the exception of a Property's persistence. However, THE key difference is in a Property's scope (the script object in which it's declared) versus a Global's scope (the entire namespace).

Why has it taken so long for this message to sink in? (Rhetorical question - so don't bother people ;-)

What mechanism do you propose (barring the use of a third party app such as Loader written by someone nearby), to reference libraries of routines?

The Loader system makes use of an applet when binding the Loader library (actually, a proxy to it) to scripts at compilation time:


property _Loader : run application "LoaderServer"

With my fresh understanding, I'll go back and look at Loader afresh.

Once again, thanks for sharing your valuable time and expertise.

Simon Forster
_____________________________________________________
 LDML Ltd, 62 Pall Mall, London, SW1Y 5HZ, UK
 Tel: +44 (0)70 9230 5244   Fax: +44 (0)70 9230 5247
_____________________________________________________

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: Script Libraries (From: has <email@hidden>)
 >Re: Script Libraries (From: Simon Forster <email@hidden>)
 >Re: Script Libraries (From: has <email@hidden>)

  • Prev by Date: Re: Can I Speed Up This Folder Browsing Script?
  • Next by Date: Re: Can I Speed Up This Folder Browsing Script?
  • Previous by thread: Re: Script Libraries
  • Next by thread: Read a cell in Excel 2004
  • Index(es):
    • Date
    • Thread