InDesign Script select Page and Layer
Hi all
I need to select all graphics on a page, but only on a given layer.
myDocument.pages[myPageCounter].allGraphics.length
This works fine.
myDocument.pages[myPageCounter].layers.itemByName("[myLayerName]")
As soon as I try to bring in the layer into this I fail.
Appreciate any hints
Regards
Romano
Some more context...
==================
| myLabelStyle = myDocument.paragraphStyles.item(myLabelStyleName); | |
| mySwatch = myDocument.swatches.item(mySwatchName); | |
| myLayer = myDocument.layers.item(myLayerName); | |
| if (myConfirmation == true){ |
for(var myPageCounter = 0; myPageCounter < myDocument.pages.length; myPageCounter ++){
$.writeln("The current page counter = " + myPageCounter);
for(var myGraphicsCounterPerPage = 0; myGraphicsCounterPerPage < myDocument.pages[myPageCounter].layers.itemByName("[myLayerName]"), allGraphics.length; myGraphicsCounterPerPage ++){
$.writeln("The current graphics counter per page = " + myGraphicsCounterPerPage);
myGraphics = myDocument.pages[myPageCounter].allGraphics;
myAddLabel(myDocument, myGraphics[myGraphicsCounterPerPage], myGraphicsCounterPerPage, myLabelType, myLabelHeight, myLabelOffset, myLabelStyle, mySwatch, myLayer, myStoriesArray);
}
}
| } |