Changing value for Property of a script Library

dear all,

I have a library of handlers like:

on SendMessageToMe theText sendFile theFile : missing value
  --  code here
end endMessageToMe theText sendFile theFile : missing value

For some of them I would like to consider a (boolean) property that I declar at the top of the library

property allowDispatchTest : true

such as:

on SendMessageToMe theText sendFile theFile : missing value
   if allowDispatchTest then
    -- code here
   end
end endMessageToMe theText sendFile theFile : missing value

Now the tricky part:

I would like to change the value for this property from an external script. And let this new value be used by the handlers of the library as usual.

Which would be the best approach for this and the most efficient (some of these handlers are call 10 times per seconds)?

Libraries are cached, so unless the “external” script is run by the same process (and not always then), you can’t. You’ll need to do something like using user defaults.

The best approach depends a bit on how the scripts that use the libraries are run. If they’re in a stay-open app, for example, they’ll need a different approach than if you’re running them from, say, FastScripts.

Thanks. This helps!