Indesign CS4 group all items on page

Can anyone help me with the following issue.

I have a Indesign document with 14 pages.
I want to group all items on every page.

I can’t seem to find anything about “walking through” a document and about how to group items.

Everything I’ve tried resulted in errors.

So after a week of headache :frowning: … does anyone has a solution for this?

Thanx in advance

Model: iMac 24
AppleScript: 2.3
Browser: Firefox 47.0
Operating System: Mac OS X (10.6.8)

Hi there,

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

HTH

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.

https://wwwimages2.adobe.com/content/dam/Adobe/en/devnet/indesign/pdfs/indesigncs4_scriptingtutorial.pdf


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.