omniJS – Reproducible crash creating new row with note text

In OO 5.2 test (v184 r294149)

we can reproducibly crash OO by entering the following line in the Automation Terminal:

this.rootItem.addChild(null, x => {x.topic = 'Test'; x.setValueForColumn('Note text', this.noteColumn)})

Which attempts to create a new outline node, populating it with Topic and Note text.

Note that

x.topic = 'Test'

on its own works fine in this context.

The crash is triggered by the additional attempt to add note text with:

x.setValueForColumn('Note text', this.noteColumn)})

(The omniJS interface has convenience properties for .topic and .state, but unlike the AppleScript/JXA interface,
doesn’t seem to have a .note property for setting note text more directly …)

(In this context the this keyword is being used as a reference to the Outline object)

I wondered whether doing this in two steps would be a workaround:

  1. Script-create a new last row with just a Topic text
  2. Then use omniJS to add note text to the existing (script-created) row.

but we still get a crash as long as the row is script-created.

(I haven’t seen this with rows that were manually entered through the GUI - they seem happy to find a place for omniJS-specified noteColumn text)

–> Crash …

I thought the crashing (which had spread to creating any new document) had now been cleared (on this system) by a root and branch uninstall and reinstall.

In fact, however, tho I can now create new docs, I’m still getting this:


x.setValueForColumn('Note text', o.noteColumn)

Where x is any script-created new row, and o is the outline

(5.2 test (v184 r294149))

It doesn’t seem to make any difference whether .setValueForColumn is called on Item or on TreeNode, both are crashing in this build (OO 5.2 test (v184 r294173)) with the outline.noteColumn cell of script-created items / nodes.

(() => {
    'use strict';

    // log :: a -> IO ()
        const log = (...args) =>
                .join(' -> ')

            o = document.outline,
            e = document.editors[0],
            itemNew = o.rootItem.addChild(null, x => {
                x.topic = 'Something topical'
            nodeNew = e.nodeForItem(itemNew);

        itemNew.setValueForColumn('something notable', o.noteColumn);

        //nodeNew.setValueForColumn('(or noteworthy)', o.noteColumn);

Bug report filed! Thanks for letting us know.

1 Like

The crash should be fixed in builds numbered 294341 or later. I’ve also added a convenience note property to access the note as a plain String, like the topic property. Thanks!

1 Like

Perfect. Thank you !

Excellent. The note property is so useful. Thanks Tim.