Grouping selected objects in Indesign via AppleScript
As part of a larger script, I need to group a few preselected objects. Can't figure out what i'm doing wrong.
Here's a snippet:
-- Select the image and caption, group them
set selection to {myRectangle, captionFrame}
set myGroup to group {myRectangle, captionFrame}
They get selected fine, but the group doesn't work:
error "Adobe InDesign 2025 got an error: Can’t get group {rectangle id 6639 of spread id 218 of document id 1, text frame id 6665 of spread id 218 of document id 1}." number -1728 from group {rectangle id 6639 of spread id 218 of document id 1, text frame id 6665 of spread id 218 of document id 1}
Any ideas?
