I'm not sure this is possible but perhaps forum members would offer suggestions.
I don't intend to do this with a script at this point.
I have multiple objects I want to select on an artboard but it is tedious to select them all one by one. And I need to repeat this operation on other artboards, where the objects I want to select are positioned the same way. Is it possible to create a template of some sort, maybe made of those objects I want to select, position the template on the artboard and select all objects that are positioned right underneath the template?
It would be a little similar to "Select All in Active Artboard" except that it would be "Select All Objects that Overlap with Template".
This would be for CS4.
Probably I can somehow imagine what you are looking for, but it may be useful if you were providing a sketch that illustrates the desired selection routine.
Or better yet a sample Illustrator file with further instructions.
I've attached a picture and will attempt to explain what I'd like to do. I'm not sure it will be much clearer but I'll try.
Imagine I have an artboard with numerous objects on it. I want to select only the little boxes. I can do that by hand, one by one, But because I have multiple artboards with a similar pattern, I'd like to have some sort of template I could place on the artboard and that would "somehow" indicate where the selection should happen on the artboard. For example, I could simply copy those objects as my template or put something in the template that indicates "anything that overlaps with the none empty areas in the template must be selected". The boxes I am selecting are of similar appearance in this case but they could be different/unrelated objects (one could be a square with yellow fill, one could be text, one could be a circle with green fill and so on).
Is that any clearer? I don't know if it's possible to come up with a scheme in AI that would allow to do this and be much quicker than manual selection.
Yes, this sketch is helpful. Thank you.
My first thought was that you are looking for something that has been requested for decades: An optional selection routine that only selects objects which are fully enclosed by the selection marquee (rather than merely a touch-sensitive routine).
Some other vector applications do provide that toggle either with a preference setting and/or by using a keyboard modifier. For decades, by the way.
Considering your artboard on the right, it is probably not exactly the behaviour you want, but at least it is something similar.
Unfortunately, Illustrator still does not provide this toggle for some unknown reasons and I don't know any effective workaround that may compensate the absence.
I think there is a plugin that may help, but I cannot remember its name at the moment.
Thanks Kurt for the explanation. I think this would not be a good task for scripting either. I suppose I will have to do it manually with a great deal of patience.
Switching to the new forum software may have ruined the script selectWithinRect.jsx written by @CarlosCanto (but most of the time it's just missing the counters in square brackets) - but if it works it should do what you want.
Hi Wade, I scripted it the way Marie originally wanted it, by defining a "window".
keyboard short cuts for scripts do not stick
I have made a coupe of tutorials on how to run scripts via 2-clicks and shortcut key stroke for Windose. They don't involve programming, so I wonder if there are similar features on the Mac that could do something similar. Hover the mouse over my username to check those out.
// script.name = selectWithinRect.jsx;
// script.description = selects all items fully enclosed by a top most Rectangle;
// script.required = draw the "selection Marquee" Rectangle first before running;
// script.parent = carlos canto // 5/25/11;
// script.elegant = false;
var idoc = app.activeDocument;
var topPath = idoc.pathItems;
var tpVB = topPath.visibleBounds;
var left = tpVB;
var top = tpVB;
var right = tpVB;
var bottom = tpVB;
for (i = 1 ; i<idoc.pageItems.length; i++)
var iart = idoc.pageItems;
if (isPointIn(top,left,bottom,right,iart) == "true")
iart.selected = true;
var vb = iart.visibleBounds;
ileft = vb;
itop = vb;
iright = vb;
ibottom = vb;
if ( ileft>left && itop<top && iright<right && ibottom>bottom)
Hi pixxxelschubser. Thanks for the info. I'll take a look at the thread. However, in my case (and the example in the image shows it by chance), I may not select all objects within the marquee but only some. Probably for me, that script could be modified to define a collection of marquees and select all objects within the collection (a variant could be all objects overlapping with the collection of marquees).
Honestly? I don't see any difference.
But it may be that Global edit could help you too.
One of the rectangles in the marquee is not selected.
Global Edit is not available in CS4. Similar features like "selecting all objects with the same stroke" will not accomplish what I am looking for (unless everything was thought out prior to the selection for that purpose, but it's not the case).
Thank you for your response. I see it now.
There may not be a workaround. However, it is difficult to ponder advice or workarounds without seeing a detailed example or sample file. A sketch is not enough for me in this case. I'm so sorry