MACSCRPT Archives

January 2010

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Tetsuro KURITA <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Wed, 20 Jan 2010 01:31:55 +0900
Content-Type:
text/plain
Parts/Attachments:
text/plain (47 lines)
ModuleLoader is a scripting addition to search and load script libraries/
modules. It allows you to load a module with spcifing only its names. 

http://homepage.mac.com/tkurita/scriptfactory/en/XModules/contents.html#ModuleLoader

ModuleLoader searchs modules/libraries from predefined locations (~/Library/
Scripts/Modules, /Library/Scripts/Modules are defaults) by its names or 
subpath and load it as script objects like "load script" command. You don'
t need to maintain a full path to a module by hand like "load script" command.
Also ModuleLoader can resolve dependencies of modules automatically. i.e.
modules required with the loaded module are also loaded to the module. 

The libraries and modules for ModuleLoader are normal AppleScript's product
i.e. compiled scripts, script bundles, applets and droplets. Also ModuleLoader
have many functions for loading scripts. But you can start to use ModuleLoader
as a better "load script" command. You don't need to rewritten your libraries
at the beginning. 

A new scheme for loading modules was introduced from version 2.1. The new
scheme allows to minimize code to load modules. 

Some examples :

== A top level script

property Module1 : module
property loader : boot (module loader) for me

== A module which depends on other modules.

property Module2 : module

The "module" command in the property definition mark the property as a place
where a module is loaded into. "boot (module loader) for me" statement cause
actual loading modules and set the modules to the specified properties. 

I believe ModuleLoader could be the best solution for a module loading system
of AppleScript. Please check details of ModuleLoader with the manual.

I welcome any comments, suggestions and questions, even if it's negative.

=======================================================
Tetsuro KURITA
E-mail: [log in to unmask]
http://homepage.mac.com/tkurita/scriptfactory/en/
=======================================================

ATOM RSS1 RSS2