3 Replies Latest reply on Nov 29, 2017 1:11 AM by OMOTI

    Redimension lots of objects (circles) separately

    ckiltoliert33552576 Level 1

      Hi everyone !

       

      This question may have already been answered, but I didn't find any.

       

      Here is my issue : I'd like to selection a lot of different object (which are circles) and redimension each of them separately to 10px (they are at 13 px right now)

       

      Someone told me I should use a script, but I don't know how, does anyone could help me with that ?

       

      Thank you for your kindness

        • 1. Re: Redimension lots of objects (circles) separately
          OMOTI Level 2

          Hi,

           

          Is "redimension" mean resizing?

          It is easy to resize each object. But It is difficult for me to align pixel grid after resizing via script. If you create something like an icon for web, you may need it.

          The following script resize each selected object (excluding stroke width).

           

          If your work is like this, try:

           

          (function () {
              if (app.documents.length === 0) {
                  return;
              }
              
              var doc = app.activeDocument,
                  sel = doc.selection,
                  size = new UnitValue(10, "px").as("pt"),
                  i,
                  max;
              
              for (i = 0, max = sel.length; i < max; i += 1) {
                  if (sel[i].hasOwnProperty("resize")) {
                      sel[i].resize(size / sel[i].width * 100, size / sel[i].height * 100);
                  }
              }
          }());
          
          • 2. Re: Redimension lots of objects (circles) separately
            ckiltoliert33552576 Level 1

            Thank you for your answer, I will try it as soon as I learn how to use scripts in Illustrator !

            • 3. Re: Redimension lots of objects (circles) separately
              OMOTI Level 2

              Hello!

              Did you know how to use the script?

              Copy and paste this code using a text editor and save it as a text file with the name of "favoriteName.jsx".

              Launch Illustrator and navigate File > Scripts > Other Script and choose the file "favoriteName.jsx".

              Then the script is executed.