Re: AppleScript error, overflow.
Re: AppleScript error, overflow.
- Subject: Re: AppleScript error, overflow.
- From: has <email@hidden>
- Date: Fri, 8 Jul 2005 20:29:34 +0100
Scott Babcock wrote:
>I've encountered this issue as well. In my case, it turned out that I
>was duplicating my libraries when I thought I was merely storing
>references.
>
>The way I solved this is to have my core library manage the loading of
>all the other libraries, storing them in properties in the core library
>itself. A script or library that needs a particular library sends a
>request to the core library to load it. The core library then checks to
>see if the requested library is already stored in its cache. [...]
Have you looked at AppleMods' Loader system? <http://applemods.sourceforge.net/>
>The critical pieces, though, are the phrase 'a reference to'
This is actually redundant. The only times a script object will be duplicated is if you use AppleScript's 'copy' command on it or send it to an osax or other application. Otherwise it's the same object you're passing about.
>storing the libraries in properties.
If you mean storing, say, library A in property A, library B in property B, etc. this makes for poor reusability since it ties that implementation to a single system. What you really want is to store them all in an associative list; that way your library management code doesn't need to know anything about the libraries it's loading. One of the major advantages of libraries is meant to be reusability, after all. :)
Again, take a look at Loader; heck, even better: why not use it yourself? It's why I wrote it and gave it away, after all, and while it's not perfect it's pretty darn good. It won't bite, and if you find the developer docs aren't up to scratch you'll know who to chew. ;)
has
--
http://freespace.virgin.net/hamish.sanderson/
_______________________________________________
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