Back

Script

Hello World

Loads a local JavaScript file synchronously to your app to make its functionality available in your app.

app.Script( file )

See Also: LoadScript

Example - Compute the Answer to the Ultimate Question of Life, the Universe, and Everything

var scriptJS = `
var num = 7;
function computeNum() { return 6 * num; }
`
;

function OnStart() {
    app.WriteFile( "script.js", scriptJS )
    app.Script( "script.js" );

    app.ShowPopup( "script.js loaded." );
    app.Alert( computeNum(), "computed number: " );
}
    Copy     Copy All       Run      
string: path to file or folder ( “/absolute/...” or “relative/...” )