Adding graphic to existing group

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, is read-only, so my initial guess that it’d be something like this just won’t work: marker )

It fails silently.

I tried this too and it didn’t do anything:

marker.orderAbove([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.

So… little help?

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:

    // groupExpandedAtIndex :: Group -> Int -> Shape -> Group
    const groupExpandedAtIndex = (group, index, shape) => {
      const props = {
          userData: group.userData
        xs =,
        lng = xs.length;

      return (
          new Group(
            index > lng ? (
            ) : index < 1 ? (
           ) : xs.slice(0, index).concat(shape).concat(xs.slice(index))

    return groupExpandedAtIndex(unit, 5, marker)
  => x.text);

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:

    // groupWithAddedShape :: Group -> Shape -> Group
    const groupWithAddedShape = (group, shape) => {
        props = [
        ].reduce((a, k) => Object.assign(a, {
          [k]: group[k]
        }), {}),
        xs =;

      return (
          new Group([shape].concat(xs)),

    const expandedGroup = groupWithAddedShape(unit, marker);

Hmm, that might work, actually. I’ll give it a go. Thanks!

Still, any Omni folks reading this: Seems like something that should be possible out of the box.

1 Like