Skip to content

Storing Data In A Target Engine

Fabian Morón Zirfas edited this page Jun 13, 2025 · 3 revisions

storing data in a target engine

For exchanging values between scripts you can make use of a targetengine, in which, while the program is active, data can be stored. This advanced solution can have many stumbling stones.

// create a new engine
#targetengine "session"

This will keep the engine alive as long as the program is running.

// store a value
myVar = 42;

Now you can access this value from another script as long as the engine is alive.

Script one

    #targetengine "session01"
    var myValue = 0; // new value
        alert(myValue); // result is 0
        myValue++; // increment by 1

Script two

    #targetengine "session01"
        alert(myValue); // result is 1

Have a look at this gist and this stackoverflow question

Home

Clone this wiki locally