A great scripting implementation would be unusable without the tools to create the scripts, actions, libraries, and plugins integrated into Omni suite of applications for macOS and iOS. That is why every Omni application has a built-in script console in which you can develop, test, and execute your Omni Automation JavaScript scripts.

For example, the following animation shows use of the console in OmniGraffle for macOS:

Console Functions

In addition to providing a means for running Omni Automation scripts, an Omni application’s console window allows scripts to “log” debugging, warning, or error information where it can be viewed in the system console or in the console output area. A single instance of the Console class is available to scripts as the console global variable.

Here are the functions supported by the Console:

A simple logging of a text string:


An example using the (optional) “additional” parameter to include the shape of the item being processed in the log statement:

console-01 console-02

Using the (optional) “additional” parameter to include unique identifying information about the object causing the error:


An informational example that creates and displays an informational data dictionary for each processed object:


Posting a warning about graphic names containing spaces:


Placing the console.clear() function at the start of the script will remove previous messaging from the console window and only display the results of the current script:


Graphic Summary

Here’s an example of using console logging to review the status of the graphics in the current canvas. Run the script with the OmniGraffle console window open to view the results.

Note the use of JavaScript Ternary operators in lines 8 and 10:

console.clear() graphics =[0] graphics.forEach(function(graphic, index){ obj = new Object() obj.layerName = = = obj.type = graphic instanceof Line ? "Line" : graphic.shape if (obj.type != "Line"){ obj.image = graphic.image instanceof ImageReference ? true : false } else {obj.image = false} obj.locked = graphic.locked console.log("Graphic " + String(index),JSON.stringify(obj)) })

“Pre-Flight” Documents

Here’s an example of using the console to Pre-flight a document prior to saving, printing, or processing. If installed as an action, the results will log to the application’s console window when the action is selected from the Automation menu.

This example script checks for graphics that are unnamed or are set to not print. You can edit the script to check for the document or graphic properties you require.

console.clear() var cnvs =[0].selection.canvas var cnvsName =, index){ obj = new Object() obj.canvasName = cnvsName obj.layerName = = = obj.type = graphic instanceof Line ? "Line" : graphic.shape if (obj.type != "Line"){ obj.image = graphic.image instanceof ImageReference ? true : false } else { obj.image = false } obj.locked = graphic.locked obj.prints = graphic.layer.prints objStr = JSON.stringify(obj) if (obj.prints === false){ console.warn("Non-Printing Graphic " + String(index),objStr) } else if ( === null){ console.warn("Unnamed Graphic " + String(index),objStr) } else {"Graphic " + String(index),objStr) } })

Action Template Generators

When it comes to creating and adding Omni Automation actions to your Omni applications, the Action Template Generators are your best friend. They are webpage forms for quickly generating automation action documents for OmniGraffle and OmniOutliner.

Just fill in the action metadata information, choose the action input, and then TAP|CLICK the Show Template button!

The “Copy as JavaScript” Command

Here’s a fantastic way to quickly learn how to create objects and adjust the values of their properties: just ask Omni!

While an object(s) is selected, choose “Copy as JavaScript” from the Edit menu (macOS). The Omni Automation script for creating the object will be placed on the clipboard. Paste into the application’s Console, a Web Console, or a text editor to view the step-by-step procedure for re-creating the object. Very instructive!


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