RE: Who has that property?
RE: Who has that property?
- Subject: RE: Who has that property?
- From: has <email@hidden>
- Date: Wed, 9 Nov 2005 11:40:47 +0000
Scott Babcock wrote:
>The main system library contains a handler to scan for library-reference
>properties and populate them automatically
Sounds voodoo-ish. Rule 1 of Reliable AppleScript Programming: don't get smart, it doesn't like it. It's like trying to drag-race in a beloved old Model-T jalopy - put your foot down too hard and the wheels will probably fly off.
Anyway, your design is all backwards: libraries should have responsibility for loading their own dependencies. See Modular Programming 101, Coupling. (Scott Norton, an old-time list resident and all-round braniac, patiently drilled this stuff into me way back when I was learning to design my own library-oriented systems.)
>- something like the way #include works in C.
If you want includes, use Script Debugger's library management mechanism. It's proprietary, but assuming you don't need to edit these scripts in any other editor then this won't be a problem.
>The script-runner applet runs text script files
>with the 'run script' event, which means that the script files are
>compiled into script objects whose parent is the applet.
Not unless you instruct them to do do, or your script editor has somehow screwed up all your contexts again. Scripts compiled within 'run script' take the AppleScript object as their parent, unless you specify another via their 'parent' properties.
>The applet uses a few of the system libraries itself, and so it contains
>library reference properties. The library loader was seeing these
>properties, which were not part of the script being run but of the
>script runner itself. The library loader then tried to populate these
>properties, which threw an error and caused the run to fail.
Two recommendations:
1. Enquire about your context pollution problems on LNS's SD mailing list and/or their support desk. If SD is the culprit as you suspect (it's definitely not AS's doing), the LNS folks will be able to shed light on the situation better than folk here, as it's either a "feature" - in which case they can explain it (and, hopefully, tell you how to disable it) - or it's a bug, in which case they really need to fix it.
2. Replace your current library loading system with a better one. AppleMods' Loader system <http://applemods.sourceforge.net/getstarted.html> is solidly engineered and reliable, and it should be more than adequate for your needs. Altering your existing libraries to Loader format won't take much work; just adding standard headers and repackaging the files. Developer docs are here: <http://freespace.virgin.net/hamish.sanderson/LoaderDocs.sit>, and I'll be happy to answer any questions.
HTH
has
--
http://freespace.virgin.net/hamish.sanderson/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden