Scripting Question: Pass variable from one script to another (Make variable global)

Hi,

I would like to know if it is possible to store a variable globally so that it could be passed to another script.

expl.:

1. ) I run my first script which declares the variable ‘globalVariable’.
Script 1 “Global_Variable_01_SetVar.js”:

////// Script 1 START //////

var globalVariable = “Hello”;

if (typeof globalVariable !== ‘undefined’)
{
MessageBox.information("globalVariable = " + globalVariable);
}
else
{
MessageBox.information(“globalVariable does not exist”);
}
////// Script 1 END //////


2.) The second script should read and use the global variable.
Script 2 “Global_Variable_02_GetVar.js”:

////// Script 2 START //////
if (typeof globalVariable !== ‘undefined’)
{
MessageBox.information("globalVariable = " + globalVariable);
}
else
{
MessageBox.information(“globalVariable does not exist”);
}
////// Script 2 END //////

But it doesn’t. Is there a way to store variables globally as long as a scene (or stage) is opened?

stefman

BTW: It would be great if there was a scripting section in the forum. :wink: