I don’t have CS4, on my Mac, but this works in CC2015.
tell application "Adobe InDesign CC 2015"
repeat with thisPage in every page of front document
set myGroup to make group at parent of item 1 of (all page items of thisPage) with properties {group items:(all page items of thisPage)}
end repeat
end tell
Hi, Nik. That’s fine, but maybe too complex; the parent reference may obscure the goings-on for a newbie.
OP: While there may not be an example of this exact scenario in the InDesign scripting guide, there are uses of the repeat and make commands that can help you understand the basic mechanics of looping and addressing objects. See link below.
tell application "Adobe InDesign CS4"'s document 1
repeat with num from 1 to count pages
tell page num to make group with properties {group items:page items}
end repeat
end
Thanks for the explanation and the simplified version Marc.
I’ve just had a play around with my version and shortened it.
tell application "Adobe InDesign CC 2015"
repeat with thisPage in every page of front document
tell thisPage to make group with properties {group items:page items}
end repeat
end tell
I’d started with something similar however I was getting an error. I think it’s because I wasn’t referencing the current page.