Re: Libraries and effiency
Re: Libraries and effiency
- Subject: Re: Libraries and effiency
- From: Tetsuro KURITA <email@hidden>
- Date: Sat, 31 Jul 2010 10:13:11 +0900
I recommend to try "ModuleLoader".
http://homepage.mac.com/tkurita/scriptfactory/en/XModules/index.html#ModuleLoader
"ModuleLoader" is an OSAX of module/library loading system for AppleScript.
"ModuleLoader" can load normal AppleScript stuffs (script files, script bundles, applets/droples) like "load script" command. But "ModuleLoader" can load a library with specifying its name from predefined locations.
Also many advanced feature of "ModuleLoader" can solve all your problems.
On 2010/07/30, at 22:34, Jim Brandt wrote:
> Would I be better off if the handlers were grouped in separate libraries (say all the date handlers in one library, all the file handlers in a library, etc.), and each was loaded as needed?
>
> This means I would have to go through lots of scripts and change the single load to multiple loads, depending on the usage. Is the efficiency worth it? Is there even any gain in efficiency by doing loads of multiple smaller libraries over one big library?
Handlers should be grouped in separate libraries for the maintenance of libraries.
"ModuleLoader" can help handling and managing many libraries with minimum efforts.
> Also, how do I handle (no pun intended) using handlers from one library in a second library?
> I.e. Library A needs to call a routine that's in library B. Right now, they're both in the same library, but if I break libraries up by commonality this will no longer be true.
"ModuleLoader" can automatically load libraries which loaded libraries require.
> Is load script smart enough to only include one copy in a script if it's loaded from both the main script and from a loaded library? Can a library scrpit even load another library? If not, what's the best way to "share" libraries?
"load script" command is simple. A script loaded form both the main script
and form a loaded library is not shared.
On the other hand, "ModuleLoader" is very smart. One copy of a library can be shared in the main script and loaded libraries.
Please try "ModuleLoader". It is a best solution for AppleScript libraries.
=======================================================
Tetsuro KURITA
E-mail: email@hidden
http://homepage.mac.com/tkurita/scriptfactory/en/
=======================================================
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden