OmniJS and the Workflow App

workflow-logoOmniJS scripts as encoded links can be easily executed by the free Workflow app on iOS.

Simply add the URL action to your workflow document and paste an OmniJS script link (like the one below) into its input field.

app.activate()
omnigraffle:///omnijs-run?script=app%2Eactivate%28%29

Follow the URL action with the Open URLs action and save the workflow.

TIP: You can use the Web Console page to turn your OmniJS scripts into links.

Workflow in Workflow App

When the workflow is run, the OmniJS script will be executed.

Here’s a short video demonstrating using the saved example as a Workflow extension

Run an OmniJS Script on the Clipboard

Here’s a workflow that converts OmniJS script code on the clipboard into an OmniJS script link and executes it. Save it as a Workflow extension and it will be widely available.

Run Script using Clipboard Content

Inserting Content into an OmniJS Script

Here’s a workflow that will insert the clipboard text contents into an OmniJS script that creates a textbox containing the text, in the open OmniGraffle document. The process requires the use of multiple workflow variables and the search and replacement of an arbitrary placeholder string (XXXXX).

And here’s the script for creating a text box containing the text that replaces the “XXXXX” placeholder:

nRect = new Rect(0,0,300,300) aShape = document.windows[0].selection.canvas.addShape('Rectangle',nRect) aShape.text = 'XXXXX' aShape.shadowColor = null aShape.strokeType = null aShape.fillType = null aShape.autosizing = TextAutosizing.Overflow aShape.textHorizontalAlignment = HorizontalTextAlignment.Left aShape.textHorizontalPadding = 0 aShape.textVerticalPlacement = VerticalTextPlacement.Top aShape.textVerticalPadding = 0 aShape.textSize = 14
omnigraffle:///omnijs-run?script=nRect%20%3D%20new%20Rect%280%2C0%2C300%2C300%29%0AaShape%20%3D%20document%2Ewindows%5B0%5D%2Eselection%2Ecanvas%2EaddShape%28%27Rectangle%27%2CnRect%29%0AaShape%2Etext%20%3D%20%27XXXXX%27%0AaShape%2EshadowColor%20%3D%20null%0AaShape%2EstrokeType%20%3D%20null%0AaShape%2EfillType%20%3D%20null%0AaShape%2Eautosizing%20%3D%20TextAutosizing%2EOverflow%0AaShape%2EtextHorizontalAlignment%20%3D%20HorizontalTextAlignment%2ELeft%0AaShape%2EtextHorizontalPadding%20%3D%200%0AaShape%2EtextVerticalPlacement%20%3D%20VerticalTextPlacement%2ETop%0AaShape%2EtextVerticalPadding%20%3D%200%0AaShape%2EtextSize%20%3D%2014
place-clip-workflow
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