Back

LoadBoolean

JS Py
Hello World

Load a saved boolean value to remember varibale values between multiple app starts.

app.LoadBoolean( name, default?, file? ) → Boolean

See also: SaveBoolean.

Example - Detect First Start

var file = "demofile";

function OnStart()
{
    var first = app.LoadBoolean( "first", true, file );

    if(first)
        app.ShowPopup( "You ran this demo for the first time!" );
    else
        app.ShowPopup( "This is not the first time you have run this demo." );

    app.SaveBoolean( "first", false, file );
}
file = "demofile"

def OnStart():
    first = app.LoadBoolean( "first", true, file )

    if first:
        app.ShowPopup( "You ran this demo for the first time!" )
    else:
        app.ShowPopup( "This is not the first time you have run this demo." )

    app.SaveBoolean( "first", false, file )
    Copy     Copy All       Run      
Boolean
String
String: path to file ( “/absolute/...” or “relative/...” )