Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


How to select only objects within a selection marquee?

Explorer ,
May 24, 2011 May 24, 2011

Copy link to clipboard

Copied

I am a new user of Illustrator CS5, switching from Freehand. I am trying to find out if there is a way to select only the objects within a selection marquee? In AutoCAD you can make a selection window from left to right and only those objects entirely within the window are selected. If you window from right to left all objects that are "crossed" or touched by the window are selected. Is there a similar technique in Illustrator?

Currently I have to select the objects, then go back and hold the shift key to deselect the object I don't want, or lock layers to prevent extra objects getting selected.

Views

45.2K

Likes

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 , Sep 04, 2012 Sep 04, 2012
No

Likes

Translate

Translate
Adobe Community Professional ,
May 25, 2011 May 25, 2011

Copy link to clipboard

Copied

Works fine on my Mac (OSX 10.5.8, AICS4)

Likes

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
Explorer ,
May 25, 2011 May 25, 2011

Copy link to clipboard

Copied

Just tried it again and it crashed. Maybe I am doing the steps wrong. I went

to File>Scripts>new script and get the swirly disc. Am I supposed to be

choosing a tool first? Or select my objects?

Likes

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 ,
May 25, 2011 May 25, 2011

Copy link to clipboard

Copied

With your file open, draw a rectangle which encloses some objects entirely and cuts across others. With that object still highlighted, File>Scripts>(whatever you called the script). It should delete the object you drew and highlight only those objects entirely within the area of the object.

Likes

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 ,
May 25, 2011 May 25, 2011

Copy link to clipboard

Copied

cool, thanks Larry

Marie, maybe the problem is in what you actually saved,


you should have copied starting here

#target Illustrator

//  script.name = selectWithinRect.jsx;

then all the way down to

               return "true";
          else
               return "false";
     }

nothing else, is that what you copied?

Message was edited by: CarlosCanto

Likes

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
Explorer ,
May 31, 2011 May 31, 2011

Copy link to clipboard

Copied

Sorry, I was out of the office all weekend, yeah vacation, and will give

this all a try this week. Thanks.

Likes

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
LEGEND ,
May 31, 2011 May 31, 2011

Copy link to clipboard

Copied

What's really needed, though, is the ability to designate any simple closed path as either a selection marquee (with the contact senstive toggle, of course) or as a cutting path, and to designate any simple open path as a cutting path.

(And all path cutting tools, of course, should be able to handle open unfilled paths as well as closed or filled paths.)

JET

Likes

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
LEGEND ,
May 31, 2011 May 31, 2011

Copy link to clipboard

Copied

JETalmage wrote:

What's really needed, though, is the ability to designate any simple closed path as either a selection marquee (with the contact senstive toggle, of course) or as a cutting path, and to designate any simple open path as a cutting path.

(And all path cutting tools, of course, should be able to handle open unfilled paths as well as closed or filled paths.)

JET

I am not sure of this I think that might not be so good an idea, perhaps a precision cutting tool that you can create specialized cutting selection and even save them but turning existing paths into cutting shapes I think presents unnecessary problems. Fo instance does it remain an ordinary path if turned into a cutting path, does it auto delete itself after cutting does it have to moved once finishing the cut etc, No I think a well thought out cutting tool would work better and that should be developed by the user and the team through a test process and public input.

And I am not so sure that the cutting tools should cut the way you describe I can see where you might want to cut only closed paths even though there are open paths as well. I think it has to be thought out better.

Likes

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
Explorer ,
Jun 01, 2011 Jun 01, 2011

Copy link to clipboard

Copied

Well, I certainly opened a can of worms. Freehand was the program I used for

15 years so upon switching to Illustrator I will always use it as my

comparison point. For the work I do Freehand was perfect but our IT dept

insisted we switch to Illustrator because "Freehand will never be upgraded

and supported."

Freehand is very simple and lineal in it's process. While Illustrator has a

lot of features I like and wish Freehand had, it seems to be unnecessarily

complicated in processes. Why are there 2 different selection arrows? Why so

many special keys and toggles and secret passwords?

I have been following this discussion and personal opinions and attacks

aside, still don't know if there is a SIMPLE solution to my original

question - is there a way to select only the objects completely inside a

selection marquee without also selecting any objects partially within the

marquee?

The ideal solution would not include using several different tools and keys

and holding my mouth the right way and hoping there is a full moon visible

through the west window.

In AutoCAD, my primary program, you simply draw a selection window, left or

right, depending on what your next step would be. No special tools or

toggles or thinking ahead, it's just the primary selection process and very

intuitive.

Likes

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
LEGEND ,
Jun 01, 2011 Jun 01, 2011

Copy link to clipboard

Copied

The answer is no.

But you qualify your question.

So the amswer was no bit it would be a good option but only an option to the already existing behavior.

Likes

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
Engaged ,
Aug 31, 2012 Aug 31, 2012

Copy link to clipboard

Copied

Wade_Zimmerman wrote:

JETalmage wrote:

What's really needed, though, is the ability to designate any simple closed path as either a selection marquee (with the contact senstive toggle, of course) or as a cutting path, and to designate any simple open path as a cutting path.

(And all path cutting tools, of course, should be able to handle open unfilled paths as well as closed or filled paths.)

JET

I am not sure of this I think that might not be so good an idea, perhaps a precision cutting tool that you can create specialized cutting selection and even save them but turning existing paths into cutting shapes I think presents unnecessary problems. Fo instance does it remain an ordinary path if turned into a cutting path, does it auto delete itself after cutting does it have to moved once finishing the cut etc, No I think a well thought out cutting tool would work better and that should be developed by the user and the team through a test process and public input.

And I am not so sure that the cutting tools should cut the way you describe I can see where you might want to cut only closed paths even though there are open paths as well. I think it has to be thought out better.

@Wade

AFAIK, an "exact cutting tool" doesn't really need to be made. I personally use non-filled paths on top of closed or unclosed filled objects, and choose "Divide" from the Pathfinder panel or Menu.... every day with no problems.

Paths themselves can be "cut" using the Scissors Tool, and for real "down and dirty" on closed paths, the Knife Tool.

@ JET

(And all path cutting tools, of course, should be able to handle open unfilled paths as well as closed or filled paths.)

True.

Likes

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
Explorer ,
Jun 01, 2011 Jun 01, 2011

Copy link to clipboard

Copied

Ok, finally getting back to try this. I followed your instructions. Opened

illustrator, drew 3 rectangles to test. Selected the new script from the

file menu, last object is deleted. Tried it again, 2nd rectangle deleted.

Hmmmm.

Likes

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 ,
Jun 01, 2011 Jun 01, 2011

Copy link to clipboard

Copied

yes, the last rectangle is supposed to be your "marquee", it will get deleted. Take another look at my screen shot. I'm glad you were able to use it.

Likes

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
Community Beginner ,
Jun 08, 2011 Jun 08, 2011

Copy link to clipboard

Copied

Hi,

I'm trying to use this script (thanks for writing it by the way), but it's not working.  Is the location of the file crucial?  I don't have write permissions for the directory you suggested, so I saved it in my home folder then ran it from within Illustrator.  Absolutely nothing happened.  Any ideas what could be wrong?  I'm using a Mac. (I know for sure that I'm running the script because when I added some nonsense to the script and it generated an error in AI.)

Thanks!

Likes

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 ,
Jun 08, 2011 Jun 08, 2011

Copy link to clipboard

Copied

you're welcome, location should not matter,

add this line to the begining of the script, right after the credit comments in green, save it and run it again.

alert("Hello Orange!!");

if you get the hello message it works at that location. do you have some art and then are you drawing a "marque" with the rectangle tool before running?

Likes

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
New Here ,
Jun 08, 2011 Jun 08, 2011

Copy link to clipboard

Copied

Ah ha! Works like a charm.

I don't know what a "marque" is and had assumed that it is just a selection made with the black arrow.  After reading through your script, I realized that you are just getting the last item that was drawn, meaning I'm supposed to be drawing an object, not just making a selection.  In retrospect, I realize that "selectWithinRect" and your instructions should have tipped me off : )  Thanks for the introduction to Illustrator scripting!

Likes

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 ,
May 25, 2011 May 25, 2011

Copy link to clipboard

Copied

@Carlos: you mean the "Dock"? You can put links to any folder there. Just drag the trusted folder into the dock and there it is.

Likes

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 ,
May 25, 2011 May 25, 2011

Copy link to clipboard

Copied

got it Monika, thanks, good to know.

Likes

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
New Here ,
Oct 08, 2019 Oct 08, 2019

Copy link to clipboard

Copied

i got no such element error on line 55 [iart.visibleBounds]
what does it mean and how to fix it?
i really need this script, illustrator selection is frustating

Likes

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
New Here ,
Oct 25, 2019 Oct 25, 2019

Copy link to clipboard

Copied

Tried the script in CC2019 and got nearly the same error (Error 1302: No such element Line: 34 -> var vb = iart.visibleBounds,)

Likes

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 ,
Oct 14, 2015 Oct 14, 2015

Copy link to clipboard

Copied

A quick reply to an old thread to thank you for this script; it solved the exact problem I was having (I needed to marquee-select some text that had been converted to outlines, in a very complex AI file where everything was grouped and on one layer -- I really didn't want to have to use the direct-selection tool one letterform at a time to grab all of this, that would've taken me a long time!).

I've always felt that a perfect workaround to this issue would be to have the selection tools work as they do now in normal mode, but when in keyline mode they should only select the paths you marquee completely around. (Or at least let that me a toggle-able option for keyline mode and the various selection tools). The whole point of going to keyline mode is to get a better view of the path structure of a document, so (to me) this would make perfect logical sense.

I've submitted this feature request I don't know how many times over the last 10 - 15 years or so. Sigh... not a sexy feature, so it gets ignored.

Likes

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
New Here ,
Nov 28, 2019 Nov 28, 2019

Copy link to clipboard

Copied

Thank you Carlos! 

Having started with CorelDraw 20+ years ago, every time I use Illustrator I'm driven insane by the stupidity of this omission - so I'm hugely grateful for your script which works perfectly for me and I signed up here specifically to thank you - AND - to say that I too hit the bug that some others hit, along the lines of:

no such element error on line 55 [iart.visibleBounds]

The fix for this, I found, was on line 33, that

var iart = idoc.pageItems;

should be

var iart = idoc.pageItems[i];

Thank you SO MUCH once again!!!

 

Likes

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 ,
Jun 08, 2011 Jun 08, 2011

Copy link to clipboard

Copied

or double click the wand tool, check what you want to define and if defind corectly  click on a ... pink circle and voila all pink circles are selected...

G

( i know u know this steve its just that i started replying when i noticed it replying to you)

G

Likes

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
Explorer ,
May 25, 2011 May 25, 2011

Copy link to clipboard

Copied

I've been waiting for this feature since around 1988 or so. In my experience, every application that has a selection lasso or box works in such a way that only the items completely inside the "fence" are selected. This is the way Claris CAD, Freehand, Canvas, VectorWorks, etc. have worked and always worked. Illustrator is the only application I've ever come across where objects are selected, counter-intuitively, by everything the "fence" touches. I chuckle when I see how hard it is to explain the "inside only" concept to those who have only used AI. It's like trying to explain the wheel to people who have been dragging things around all their lives. I've been asking for it on the feature request for as long as there have been feature requests, to no avail. I used Canvas for around 10 years before coming back to AI and I was shocked that the lasso still had the crazy, backwards select-all-it-touches system. Yes, you are correct. It should work the way you expect, capturing only what is completely inside the lasso, but it doesn't. I'm up to CS4 and I think it still doesn't, not even as an option. It is just about the strangest thing in software, but there you go. So many people have used AI and nothing else that they don't notice the backwardness of it and, in fact, get used to it. It just goes to show how adaptable humans are! Other than that, it's a fine application.

MGuilfoile

Likes

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 ,
May 25, 2011 May 25, 2011

Copy link to clipboard

Copied

Michael we'll keep waiting another decade, in the meantime, the script does the job.

Likes

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
Valorous Hero ,
May 25, 2011 May 25, 2011

Copy link to clipboard

Copied

Michael Brown12 wrote:

I've been waiting for this feature since around 1988 or so....

You want too much.

I simply want to be able to add and subtract from selection dragging the black arrow but it is not possible because it toggles the selection. I wonder who needs to toggle more than add or subtract.

Likes

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