So in OmniGraffle 6, I used to be able to do this with AppleScript:
move marker to beginning of (graphics of unit)
to add a graphic object marker to the existing group unit. This doesn’t seem to work anymore in OG7, as Script Debugger gives me an NSUnknownKeyScriptError on this line.
Is there any way to do this in OmniJS? According to the help docs, Group.graphics is read-only, so my initial guess that it’d be something like this just won’t work:
unit.graphics.unshift( marker )
It fails silently.
I tried this too and it didn’t do anything:
marker.orderAbove( unit.graphics[0] )
A couple of times it failed silently and I also got an application crash once or twice.
Ungrouping unit and then regrouping with marker included isn’t an acceptable option, since unit has a name and user data assigned that would have to be saved off first and then restored. Trying to avoid that.
I’m not sure what the answer to this is either – I am probably missing something in the code below, but the order of shapes in the supplied array appears not to determine the order of shapes in the group:
But if the ordering of the group’s graphic array is not an issue, then I would personally (pace your acceptabiilty criteria :-) do something like this: