The Application Object

In Omni Automation, the OmniGraffle application object has properties (name, version) and elements (documents, stencils, windows). In a script, the application object is represented as: app

If you entered just “app” in the OmniGraffle console window and executed the line, the result would be a reference to the application object:

To get the name of the OS the app is running on:

Properties: name

The value of the name property of the application object is a string representing the name of the OmniGraffle application.

The value of the application name property is read-only.

Properties: version

The value of the version property of the application object is a string representing the version number of the OmniGraffle application.

The value of the application version property is read-only.

To create a new version object:

To extract the version string from a version object:

Comparing Versions

There are four methods you can use for comparing version objects:

Here are functions demonstrating their use:

function isBeforeCurVers(versStrToCheck){ curVers = app.userVersion curVersStr = curVers.versionString versToCheck = new Version(versStrToCheck) result = versToCheck.isBefore(curVers) console.log(versStrToCheck + ' is before ' + curVersStr + " = " + result) return result } function isEqualToCurVers(versStrToCheck){ curVers = app.userVersion curVersStr = curVers.versionString versToCheck = new Version(versStrToCheck) result = versToCheck.equals(curVers) console.log(versStrToCheck + ' equals ' + curVersStr + " = " + result) return result } function isAtLeastCurVers(versStrToCheck){ curVers = app.userVersion curVersStr = curVers.versionString versToCheck = new Version(versStrToCheck) result = versToCheck.atLeast(curVers) console.log(versStrToCheck + ' is at least ' + curVersStr + " = " + result) return result } function isAfterCurVers(versStrToCheck){ curVers = app.userVersion curVersStr = curVers.versionString versToCheck = new Version(versStrToCheck) result = versToCheck.isAfter(curVers) console.log(versStrToCheck + ' is after ' + curVersStr + " = " + result) return result }
UNDER CONSTRUCTION

This webpage is in the process of being developed. Any content may change and may not be accurate or complete at this time.

DISCLAIMER