It depends how you invoke the MyConstants script. With a tell script “MyConstants”... block, the properties belong to the MyConstants script and aren’t inherited by MyApp. Therefore, the only values that MyApp retains outwith end tell are those ten that you’ve explicitly made copies of.
Yse.
The handlers in the script library get treated in much the same manner as the properties, so if you access a handler using a tell block, you’ll need to store it in a local variable in order for MyApp to retain its own copy to use outwith the end tell.
However, this will only work if the handler being copied doesn’t itself need to reference anything from the MyConstants script, which will include any references to its properties. You might assume that if you create a copy of one the properties and give it the same name, then any references to that identifier (property name) inside a handler that you’ve copied would simply use the value that you copied over as well. But that is not the case: the handler you copy is a compiled piece of code, and the reference to a named property will be specific to the script that originally owned the handler and cannot be changed.
So you’ll likely be limited to handlers of very basic functionality that only utilise locally-declared parameters.
To not be limited in this manner, then you would need to either import the MyConstants script into MyApp, bringing with it all properties and handlers declared within; or you define an inheritance relationship between the two scripts, e.g. by adding the following property declaration to MyApp:
property parent: script "MyConstants"
Indeed. As I said above, there are some significant limitations inherent when you’re importing compiled code, such as a handler from a script library. However, I store all of my handlers as text scripts, one-per-file. I then import a handler into other scripts on an ad-hoc basis by reading in the source code as text and compiling it within the script that wants to make use of it, which is done at run time.
I’ve seen a couple of users post some pretty lengthy descriptions of their own script library implementations, and fairly recently. So you should scroll down the list of posts of do a search to have a gander at what other methods people have divised.