Copy link to clipboard
Copied
Is it possible to group 2 objects that are located on 2 different pages. Would it be something like that:
Thank you very much for your help.
Yulia
Copy link to clipboard
Copied
Unless I am wrong what you can't do in the UI can't also be done by scripting 😉
Loic
Copy link to clipboard
Copied
You can group objects from distinct pages only if they belong to the same spread.
For instance, if you have a rectangle on page 2 and a rectangle on page 3 in a "facing pages" configuration, this should work:
var doc = app.activeDocument;
var r2 = doc.pages[1].rectangles[0]; // rectangle on page 2
var r3 = doc.pages[2].rectangles[0]; // rectangle on page 3// it's better here to handle the parent spread:
var g = doc.spreads[1].groups.add([r2,r3]);
// but this may also work:
// var g = doc.pages[1].groups.add([r2,r3]);
// var g = doc.pages[2].groups.add([r2,r3]);
@+
Marc
Copy link to clipboard
Copied
Hi,
You are so right Marc, I was of course pointing that you can't group objects in different spreads. Sorry for my lack of precision and thank you to you to point this out.
Loic
Find more inspiration, events, and resources on the new Adobe Community
Explore Now