Select multiple objects / pageitems with the same name
Hi, I've hit a brick wall now with this, I've scripted making eyelet holes for a banner, at this point, i need to select all objects/ellipses i've made called "Top Eyelet", ready for the next part of the script to distribute them evenly, but I've tried loads of forum examples and other places on google, all I can get anything to do is select one single layer called "Top Eyelet", unfortunately theres at least 6 or 7, i need them all selected.
Most recent attempt was this:
// works, selects only one though
var doc = app.activeDocument;
doc.selection = doc.pageItems.getByName("Top Eyelet");
// still only selects one
var item=app.activeDocument.pageItems
for (var i = 0; i <item.length; i++) {
var doc = app.activeDocument;
doc.selection = doc.pageItems.getByName("Top Eyelet");
}
If anyone can point me in the right direction that would be most appreciated!
