JXA: Access to constants/variables in a loaded script.
I have two scripts: A loads B as scriptB.
B has a variable defined as follows (with or without var): PAD_LEFT = 1;
From script A I can access a function in script B:
scriptB.myfunc(1); This works.
scriptB.myfunc(PAD_LEFT); - PAD_LEFT not defined (OK)
scriptB.myfunc(scriptB.PAD_LEFT) runs but what is passed to the function is '[object Object]'.
Is it possible to access global variables defined in a loaded script?
Thanks,
Craig.
macOS Sierra (10.12.1)