I have a button on visio which triggers the script.
And the script has Key "MYOutput".
engine.AddScriptOutput(UIVariables.VisualOverview.CreateKey("MyOutput"), "Green");
But when I try to get the session variable in visio it is not working. Do I have to set something else on the button to get the variable?

Hi Ramesh,
You can add the "Options" shape data to your button with the "cardvariable" value (same use case for "pagevar" or "WorkspaceVar") to define the scope of the created session variable.

I believe that the session variables that are added via the engine.AddScriptOutput method are only accessible through [var:MyOutput], unless you define the scope of the variable as mentioned above.
Thanks. It worked