Re: AS Library Question
Re: AS Library Question
- Subject: Re: AS Library Question
- From: has <email@hidden>
- Date: Thu, 17 Dec 2015 17:05:51 +0000
On 16/12/2015 20:56, Stan Cleveland wrote:
On Dec 16, 2015, at 07:54 AM, has <email@hidden> wrote:
I suppose if you were really desperate for a 'reliable' library loader (or just don't fancy rewriting your existing AM Loader-based systems to use AS's loader), you could even turn AM Loader into an AS library itself.
This may have been an off-handed remark on your part, has, but is an attractive and tenable option. It may be the lowest-hanging fruit, but it’s also rather tasty fruit.
On the one hand, preserving your existing Loader-based investment (and
it sounds like you've built a bit of an empire on it;p) does fall firmly
in the "if it ain't broke..." camp. If you open up the AMLoader.osax
bundle, you'll find the Loader.scptd library hidden in there. If you
rename it AMLoader.scptd for clarity and put it into `/Library/Script
Libraries`, you should then be able to delete the `property _Loader :
AppleMods Loader` line from all your scripts and change `_Loader's
initScript(me)` to `initScriptAtPath(me, path to me) of script
"AMLoader"`, and eliminate the troublesome osax entirely. (Obviously,
make backups first in case I've forgotten something important and you
need to revert in a hurry.)
On the other hand, you do need to weigh the cost of continuing to use a
non-standard completely-unsupported system that no-one understands,
versus a standard slightly-less-unsupported system that almost no-one
understands. If you're going to add more libraries in future, or if
someone else takes over maintenance, it may make more sense to move
everything over to the standard loader first. Technical drawbacks aside
(which, as previously discussed, can be worked around if/once you know
what you're doing), AS's loader, being built-in, provides a far better
UX, avoiding AM Loader's ugly `__load__` handlers and
essential-but-easily-forgotten DIY `initScript...()` calls.
HTH
has
_______________________________________________
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