• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: AS Library Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Re: AS Library Question (From: has <email@hidden>)

  • Prev by Date: Re: How to Run a "sudo" Terminal Command
  • Next by Date: Re: AS Library Question
  • Previous by thread: Re: AS Library Question
  • Next by thread: Re: AS Library Question
  • Index(es):
    • Date
    • Thread