XoJoScript and Constants

You can add Properties to the class that is used as context in XojoScript and its usable in XojoScript.
However constants added to the content class are not available to XojoScript.
That seems somewhat bizar. Is there a specific reason?
Is there a way around that?

Constants are replaced at compile time - but since XojoScripts can be used at runtime without recompiling the constants effectively “do not exist”. You can use a read only computed property exactly like a constant and then it is usable in the script.

Can’t you add constants inside the script itself?

Yes, you can add them in the script.

If you wanted to “automatically” inject them then you could subclass XojoScript and overload the Run method so you then tack on your own constants to the script the user supplies.