omniJS (OG access to userData dictionary

Given a user-data key, OG 7.3 (Test) already provides good access to the corresponding value for a shape.

I think it might be very useful, however, to add a graphic.userData() function for omniJS here, for direct reading of the userData dictionary itself.

This is already possible in AppleScript and JXA, and allows us to ask what user data keys a graphics has, or to get all of its data in one move.

e.g. JXA

or AS:

(() => {
    'use strict';

    const userData = Application('OmniGraffle')

    return Object.keys(userData);
use framework "Foundation"

on run
    tell application "OmniGraffle"
        tell first canvas of first document
            set recData to user data of item 2 of graphics
        end tell
    end tell
end run

on keysOfRecord(rec)
    set ca to current application
    (ca's NSDictionary's dictionaryWithDictionary:rec)'s allKeys() as list
end keysOfRecord