ObjectStore Reference

The ObjectStore is a cross‑engine storage system that allows macros, templates, JScript.NET, JavaScriptV8, and PowerShellScript blocks to share values. It is ideal for passing data between engines, maintaining state across macro calls, and coordinating complex workflows.

Overview

ObjectStore is available in all scripting engines:

Values stored in the ObjectStore persist for the duration of the macro execution session and can be retrieved by any engine or nested macro.

Functions

Both functions are available in:

Storing Values

Store any value using a string key:

JScript.NET

addToObjectStore("hello", 123);

JavaScriptV8

addToObjectStore("hello", 123);

PowerShellScript

addToObjectStore "hello" 123

Template Language

[!SET]hello[!TO]123[!/SET]

Retrieving Values

JScript.NET

var value = getFromObjectStore("hello");

JavaScriptV8

var value = getFromObjectStore("hello");

PowerShellScript

$value = getFromObjectStore "hello"

Template Language

[!VAR]hello[!/VAR]

Cross‑Engine Example

This example shows storing a value in Template Language and retrieving it from all engines.

[!SET]hello[!TO]123[!/SET]

Template Language: [!VAR]hello[!/VAR]

[!POWERSHELLSCRIPT]
$someVar = getFromObjectStore "hello"
"PowerShellScript: " + $someVar
[!/POWERSHELLSCRIPT]

[!JAVASCRIPTV8]
var jsTest = getFromObjectStore("hello");
writeln("JSV8: " + jsTest);
[!/JAVASCRIPTV8]

[!JSCRIPT]
var jsTest = getFromObjectStore("hello");
writeln("JScript: " + jsTest);
[!/JSCRIPT]

Use Cases

Notes