Manual

Manual · API

application

The application itself — what it is called, which version it is, and the one way to end it.

Every command on this page carries a worked example.

quit function

application.quit()

Ends the application — the honest way for a script that closed the last window on purpose.

Worked example
// A sign-in that failed three times leaves.
messages.showError("Three wrong attempts — the application will close.");
application.quit();

name property

application.name

What the application is called — the project's name, as built.

Worked example
form.aboutLabel.value = application.name + " " + application.version;

version property

application.version

e.g. "1.4" — the version the build carried.

Worked example
if (application.version !== settingsRecord.lastSeenVersion) {
    forms.open("WhatsNew");
    settingsRecord.lastSeenVersion = application.version;
    settingsRecord.save();
}

buildNumber property

application.buildNumber

Grows by itself with every release build.

Worked example
log("Running build " + application.buildNumber);

builtWith property

application.builtWith

Which Neuridion built this — "0.9.1 (16)". An imprint, read by nothing.

Worked example
// The support line: which Neuridion made this?
log(application.name, application.version, "· built with", application.builtWith);

bundleIdentifier property

application.bundleIdentifier

e.g. "com.example.Invoices" — where the application keeps its data.

Worked example
log(application.bundleIdentifier);   // "com.example.Invoices"

variable property

application.variable.<name>

What this session remembers for as long as the application runs — the outer of the three scopes a value can live in (a script's own let, this window's form.variable, this session). Declare the names under Application → Variables and the editor completes them, checks them and renames them; an undeclared name still works.

It is ordinary memory, not a transaction: a script that throws halfway leaves what it had already written behind. application.variable = {} forgets them all, and shared functions still belong at the top level of app.onStart.js — this is for values.
Worked example
// After a successful sign-in, for the rest of the session:
application.variable.signedInPerson = person.id;
// Anywhere else, in any window:
if (!application.variable.signedInPerson) {
    forms.open("SignIn", null, { modal: true });
}