Need a Script for OO 5.2

Hi Sal, I wonder if it might not help to prepare a basic link or footnote to regularly accompany omniJS snippets, whether for OmniOutliner, OmniGraffle, or in due course other apps ?

Many users:

  • still seem a little unfamiliar with the notion of Omni-app scripts in any kind of JavaScript,
  • are even less clear about and the notion that might actually be two different JS APIs for one Omni application

and I suspect that most users (including to some extent myself :-)

  • have really no idea at all about the best way (or perhaps any way) of conveniently running what you refer to above as an “Omni Automation” script, and which I can see, by inspection, refers to an omniJS script.

I do appreciate that there might be some hope that use of a term like ‘an Omni Automation script’ would lead users to a search engine, and thence to your own site of that name, but the real traffic would probably be increased by at least a link …

(The status of your site could, I think be another source of confusion. The naming suggests a formal link with OmniGroup, but Omni support staff seem to play down any such link if users come to them for clarification about material or technical issues encountered on your site)

The real problem though, in these early days of the excellent omniJS initiative (scripting OmniGroup apps with new and much faster APIs which run in JavaScript Contexts embedded in the OmniGroup apps themselves, rather than in JXA) is that:

  1. At this early stage it’s still fiddlier and less convenient to run omniJS scripts than AS/JXA scripts
  2. It’s much harder to test and debug them, because outside the special console, they still provide no mechanism for returning a value to the caller
  3. For the same reason (no return values), they are not yet at all well-adapted to the main use case of OmniOutliner scripting, which is data format conversion
  4. Assigning them, once made, to convenient buttons or keystrokes It’s still fiddlier and more obscured, and much less well understood than in the case of the older and slower AppleScript

To summarise

  1. The splitting of Omni (indeed Apple platform(s)) scripting into two idioms (AppleScript and JavaScript for Automation) is still not widely or fully digested.
  2. The further splitting of JavaScript scripting for for Omni apps into two APIs and two evaluation contexts is even less widely known or understood
  3. Splitting even the nomenclature of the latest bifurcation into omniJS vs “Omni Automation” (which sounds as if it could mean AppleScript, JavaScript for Automation, or omniJS, seems a bit unlikely to help with points one and two.

Very helpful to see you posting these occasional snippets, but I do think that they need to come with:

  1. A clear link to the basics of how to install and run them, and
  2. a consistent name which identifies which language they are in, and which of the two possible JavaScript contexts they can run in.

(I have noticed for example, that many assume that even JXA code, let alone OmniJS code, is executed in a browser context, and will have access to the DOM etc)

1 Like