Skip to main content
November 10, 2009
Question

group two items in Indesign CS4? - applescript, sample script attached not working

  • November 10, 2009
  • 1 reply
  • 2239 views

hello,

does anyone know why this script below does not work ? I am trying to duplicate frame with image and then group them together, but cant figure out how

any help is very appreciated . Thank you

tell application "Adobe InDesign CS4"

     tell active document
     set mySelection to item 1 of selection

     duplicate mySelection

     set mySelection2 to item 1 of selection

          tell mySelection2
          bring to front
          end tell

          make group with properties {group items:{mySelection2, mySelection}}

     end tell

end tell

1 reply

November 10, 2009

just realized I was grouping same item. New code below... but still does not work ... error "cant make class group."

tell application "Adobe InDesign CS4"

     tell active document
     set mySelection to item 1 of selection

     set mySelection2 to duplicate mySelection

          tell mySelection2
          bring to front
          end tell
     tell active document
     make group with properties {group items:{mySelection2, mySelection}}
     end tell
     end tell

end tell

Inspiring
November 10, 2009

The group command seems to insist on an "at" parameter. For example, assuming mySeelction is directly on a page:

  make group at parent of mySelection with properties {group items:{mySelection2, mySelection}}

leo.r
Community Expert
Community Expert
January 28, 2025

just in case someone comes up upon this thread looking for an answer, the answer is here:

https://community.adobe.com/t5/indesign-discussions/grouping-selected-objects-in-indesign-via-applescript/td-p/15116719