4 Replies Latest reply on Feb 22, 2016 5:07 PM by Silly-V

    Script-activated Magic-Wand selection

    Silly-V Adobe Community Professional

      The Magic Wand tool is very useful for making selections of objects with similar colors. It allows a specified tolerance and works on fill or stroke colors which are of different kinds, such as process and spot colors and best of all, it does this fairly quickly. This is a perfect way to get a selection of similar color, especially when the document is full of hundreds of shapes, without looping and being able to do so with some variance of value ranges. Is there any way to activate the same function inside of a script using any menu command or action, or anything other than using platform scripts to send mouse clicks (if that were even possible)?

        • 1. Re: Script-activated Magic-Wand selection
          CarlosCanto Adobe Community Professional & MVP

          only way I think is to send keystrokes...

           

          have you tried?

          app.executeMenuCommand("Find Fill Color menu item");

          app.executeMenuCommand("Find Stroke Color menu item");

           

          maybe you could create your own color ranges and tried the above for similar colors?

          • 2. Re: Script-activated Magic-Wand selection
            Silly-V Adobe Community Professional

            I think those are find Same Fill & Stroke, which already does not work when one shape is all white process cmyk [0,0,0,0] and another one has spot white with same values.

            I would prefer to find colors within a tolerance, and also find them regardless of color swatch kind, just like the magic wand, too bad it's based on sorcery.

            • 3. Re: Script-activated Magic-Wand selection
              CarlosCanto Adobe Community Professional & MVP

              I see, sorry I don't know if it is possible.

              • 4. Re: Script-activated Magic-Wand selection
                Silly-V Adobe Community Professional

                I wonder if it would be possible to convert all artwork colors within a range to a single one, without having to loop, or something. The Magic Wand does everything I wish, but to access it looks impossible.

                 

                EDIT: I don't know what I am doing differently, but I tried to do the same on my Windows CC2015 and did not get the expected selection with the Magic Wand.

                I just made several squares, filling them up with cmyk 0,0,0,0 to cmyk 0,0,0,5 values and also made one of them a spot color. On my Windows machine it's not selecting the spot-color shape.

                Maybe I was doing something extra on my Mac that I myself did not notice, that helped the Magic Wand select the spot color?

                 

                EDIT 2: Okay, so maybe I thought I was testing with a spot color but actually there was no spot color! Yes, looks like it only works on one or the other now. Doh!

                So, maybe the best way would be to try and narrow down a list of known colors and use setting defaultFill or stroke and using the Find Same menu item.