Taking a modular approach is a very good idea. There are a number of different ways to make different sets of values available in your scripts. Here’s one idea that you might want to consider, that uses your basic approach of storing values in different files.
For each set of values that you may want to load, create a file that’s formatted like this:
{
ValueX: SomeValue,
ValueY: "Some Other Value", -- you can include comments if you like
}
Any value that contains spaces or special symbols should be enclosed in quotes (to be safe, just enclose every value in quotes).
Near the beginning of your main script, do this:
set global constants to (:) -- an empty property list
Then, whenever your script reaches a point where it determines that a particular set of values should be available, you might have code like this:
if conditionA
add properties of (value of file "/path/to/dataSetA") to global constants
else
add properties of (value of file "/path/to/dataSetB") to global constants
end if
You can then access these constant values whenever you need to:
put global constants.valueX into importantValueToUse
Any value that hasn’t been set will just be empty.
If you don’t want to have to use the word “global” everywhere that you access your constants, you can declare the variable “constants” to be global near the beginning of each handler:
global constants
Does this approach seem like it might serve your needs? It’s not directly related to objects, although you could set your constants from properties of an object instead of reading them from a file if that made more sense in your situation.