Not sure what the best channel for small bug reports is (can’t immediately see an entry in the Tinderbox 8 main menu).
Apparent script interface bug:
- The script interface parent property correctly returns a reference to the containing document from the first top level note in the document,
- BUT for any other top level notes (following siblings of top level note one) parent appears to return an incorrect reference.
- in lieu of a reference to the containing document, it gives us a reference to the first sibling. (The first note in the document).
Test
The following should presumably return false, but for the moment (Version 8.0.3 (b374)) unexpectedly returns true.
tell application "Tinderbox 8"
tell front document
set xs to notes
-- Given two sibling notes, both at the top outline level
(item 1 of xs) is parent of (item 2 of xs)
--> **true** (expected false)
end tell
end tell
Or a different approach – using JS, and comparing IDs.
(() => {
'use strict';
const topSiblings = Application('Tinderbox 8').documents[0].notes;
const noteID = note => note.attributes['ID'].value();
// The oldest sister is not the same as the mother, but this returns true ...
return noteID(topSiblings[0]) === noteID(topSiblings[1].parent())
})();