Selecting objects with a template

Participant ,
Feb 20, 2021 Feb 20, 2021

Copy link to clipboard

Copied

Hi,

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.

Thanks.

TOPICS
How to

Views

146

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct Answer

Adobe Community Professional , Feb 20, 2021 Feb 20, 2021
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...

Likes

translate

Translate

Translate
Adobe Community Professional ,
Feb 20, 2021 Feb 20, 2021

Copy link to clipboard

Copied

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.

 

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Feb 20, 2021 Feb 20, 2021

Copy link to clipboard

Copied

Hi Kurt,

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 selectionselection.jpg.

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Feb 20, 2021 Feb 20, 2021

Copy link to clipboard

Copied

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.

 

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Feb 20, 2021 Feb 20, 2021

Copy link to clipboard

Copied

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.

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Most Valuable Participant ,
Feb 20, 2021 Feb 20, 2021

Copy link to clipboard

Copied

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.

 

How to select only objects within a selection marquee? 

 

pixxxelschubser_0-1613911843923.png

 

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.

 

pixxxelschubser_1-1613911843935.png

 

 

 

#target Illustrator

 

//  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[0];

var tpVB = topPath.visibleBounds;

 

var left = tpVB[0];

var top = tpVB[1];

var right = tpVB[2];

var bottom = tpVB[3];

 

for (i = 1 ; i<idoc.pageItems.length; i++)

     {

          

          var iart = idoc.pageItems;

          

          if (isPointIn(top,left,bottom,right,iart) == "true")

               {

                    iart.selected = true;

               }

          //alert(isPointIn(top,left,bottom,right,iart));

     }

 

topPath.remove();

 

function isPointIn(top,left,bottom,right,iart)

     {

          var vb = iart.visibleBounds;

          ileft = vb[0];

          itop = vb[1];

          iright = vb[2];

          ibottom = vb[3];

          

          if ( ileft>left && itop<top && iright<right && ibottom>bottom)

               return "true";

          else

               return "false";

     }

 

 


By @CarlosCanto

 

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Feb 21, 2021 Feb 21, 2021

Copy link to clipboard

Copied

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).

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Most Valuable Participant ,
Feb 21, 2021 Feb 21, 2021

Copy link to clipboard

Copied

Honestly? I don't see any difference.

 

But it may be that Global edit could help you too.

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Feb 21, 2021 Feb 21, 2021

Copy link to clipboard

Copied

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).

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Most Valuable Participant ,
Feb 21, 2021 Feb 21, 2021

Copy link to clipboard

Copied

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

 

 

 

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines