Re: inculding and reading from files
Re: inculding and reading from files
- Subject: Re: inculding and reading from files
- From: has <email@hidden>
- Date: Sun, 16 Jun 2002 14:24:43 +0100
Jon Pugh wrote:
>
Here's an example:
>
>
property script1 : load script (alias "where:your:script:is")
>
>
tell script1
>
-- call some handler that is defined in the script
>
end
A quick addendum re. statically vs. dynamically loaded modules...
The static approach shown above loads the other script at compile-time. If
you subsequently make changes to that other script, those changes won't be
reflected in this script until you recompile it. This can be thoroughly
tedious if you've got lots of scripts using a particular module - every
time you modify that module you have to relink all your other scripts by
hand.
If this is an issue for you, you might want to load the other script at
runtime. In turn, dynamic loading carries its own challenges. The main
problem is writing your own system to automatically locate the modules to
be loaded each time it is run (issues of portability, increased code
complexity, etc).
The AS team seems to be aware that AS is pretty weak in this area, so
hopefully we'll see improvements in a future release. (I'd love to see a
proper import statement and dynamic linking [1] built right into the
language.)
HTH
has
[1] Bearing in mind that it'd also need to be version aware in order to
avoid future DLLHell (i.e. incompatibility problems that can occur when an
older/newer version of a module is linked to a script that's expecting a
particular version).
--
http://www.barple.connectfree.co.uk/ -- The Little Page of Beta AppleScripts
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.