i tried like
runtimeScene.getGame().getVariables().get(glossary).setString(myLex);
and
runtimeScene.getGame().getVariables().get(“glossary”).setString(“ScrapShot”);
It flashes me a critical error in the debug log that “glossary” is not defined.
I open global variables in the editor and i do have a variable named glossary which is a Text variable.
The variable name needs to be in quotes otherwise Javascript will expect an object or something.
Something that has happened to me when copying stuff from the web is the quotes get changed and it doesn’t have the right type. Javascript can use the single or double quotes but not the ones that are curved with opening and closing styles.