Tinderbox Forum

Minor bug in 8.03 osascript ? parent property of top level notes


(RobTrew) #1

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())
})();

(Mark Anderson) #2

Reports should go to info@eastgate.com which is the formal tech support channel. Here by comparison is a user-to-user forum. Certainly the sort of thing above is best mailed in directly.

As well as bug/glich reports, anyone needing real tech support (stuff not working as opposed to how-to) should contact the email above in the first instance.

HTH


(RobTrew) #3

Thanks Mark - I’ll use that channel in future, and I’ve forwarded this on.