Hi,
I am struggling to get the correct syntax for this bit of my script.
I need to group all the items on a slug layer of my indesign document, but only on the active page.
This is as far as I have got:
tell application "Adobe InDesign CS5"
activate
tell document 1
set myItems to the active page's page items whose item layer's name is "Slug" --this line does not work
select myItems
set myselection to selection
make group with properties {group items:myselection}
end tell
end tell
I have tried many variations of this, but have not made anthing that works yet.
Any help would be much appriciated.
Thanks,
Matt
This seems to work:
tell application "Adobe InDesign CS5"
activate
set myDoc to the active document
set myLayer to layer "Slug" of myDoc
set myPage to the active page of the active window
set myItems to the page items of myPage whose item layer is myLayer
tell the parent of myPage to make group with properties {group items: myItems}
end tell
active page belongs to the layout window (which belongs to the application), not the document. Also—there's no reason to select the items; you can just add them to your group. And I think you always want to add the group to the spread rather than any other unit.
Jeff
North America
Europe, Middle East and Africa
Asia Pacific