22 Replies Latest reply on Nov 16, 2016 6:44 AM by siwybiwy

    Resizing in Indesign

    siwybiwy Level 1

      Hi,

       

      I want to resize 4 drawn rectangles of different random widths so that they all have the same width, but it has to fit in the space of their current position, ie when you select them all. I also want them distributed equally in the same space.

       

      Can I do this in Indesign?

       

       

      Screen Shot 2016-11-14 at 16.55.05.png

        • 1. Re: Resizing in Indesign
          Obi-wan Kenobi Adobe Community Professional

          Yes! "Alignment" Panel.

           

          (^/)

          • 2. Re: Resizing in Indesign
            Steve Werner Adobe Community Professional & MVP

            You would need to do it in two steps. You have three requirements: Same width, the group keeps current width, and equal spacing.

             

            You can't change the width with the Align panel. What width do you want them to be, that's ambiguous right now?

             

            (1) Pick the width you want, select each one and set the W (width) value on the Control panel, keeping the one on the left and right at their current position.

             

            (2) Now select all four rectangles. Using the Align panel (Window > Output & Layout > Align), select Align to Selection:

             

            InDesign CC129.png

            Then click Distribute Horizontal Centers:

             

            InDesign CC130.png

             

            Result:

             

            InDesign CC131.png

            NOTE: Illustration doesn't show equal width. I added that after I re-read your posting.

            • 3. Re: Resizing in Indesign
              Obi-wan Kenobi Adobe Community Professional

              Oups!

               

              Capture d’écran 2016-11-14 à 18.30.38.png

               

              (^/)

              • 4. Re: Resizing in Indesign
                siwybiwy Level 1

                Thanks for your reply. It's not that simple.

                 

                I don't want to pick my width or type in any value, I just want Indesign to come up with the width and space between automatically. I have, say, the width of 180mm for all 4 rectangles, and want all these different sized rectangles to have the same width and space between within 180mm.

                 

                My widths are 48, 34, 40 and 30mm, respectively.

                 

                Thanks

                • 5. Re: Resizing in Indesign
                  siwybiwy Level 1

                  I want 4 mm to be the space between. I forgot to mention that.

                  • 6. Re: Resizing in Indesign
                    Obi-wan Kenobi Adobe Community Professional

                    What width?

                     

                    (^/)

                    • 7. Re: Resizing in Indesign
                      siwybiwy Level 1

                      180mm total width, 4mm space between. Can Indesign work out what width they all have to be?

                      • 8. Re: Resizing in Indesign
                        Steve Werner Adobe Community Professional & MVP

                        InDesign doesn't do that by default. But Obi-wan will  write you a cool script!  

                        • 9. Re: Resizing in Indesign
                          Obi-wan Kenobi Adobe Community Professional

                          Aha!

                           

                          (^/)

                          • 10. Re: Resizing in Indesign
                            John Mensinger Adobe Community Professional & MVP

                            siwybiwy wrote:

                             

                            t's not that simple.

                             

                            I don't want to pick my width or type in any value, I just want Indesign to come up with the width... and space between automatically. I have, say, the width of 180mm for all 4 rectangles, and want all these different sized rectangles to have the same width and space between within 180mm.

                             

                            My widths are 48, 34, 40 and 30mm, respectively.

                            I don't get it. Developers can't install features based on scenarios and rules you have yet make up on the fly.

                             

                            InDesign has all the tools required to produce the result you need, using perhaps a dozen or more possible tool/method combinations, but like all software, it does require your input.

                             

                            Based on your 180 mm total with with 4 mm spacing, the simplest math puts your rectangle width at 56 mm. Just draw one of that width, copy it 3 times, select them all, re-click one to make it the key object, then use the Align panel to align their tops or bottoms if necessary, enter 4mm in the Use Spacing field and click the Distribute Horizontal Space button.

                            • 11. Re: Resizing in Indesign
                              Obi-wan Kenobi Adobe Community Professional

                              Just for fun!

                               

                              You have this:

                              Capture d’écran 2016-11-15 à 20.09.50.png

                               

                              … and you want that [4 mm space after resizing]:

                              Capture d’écran 2016-11-15 à 20.10.34.png

                              … So Play Rock'n Roll!  ["undo" in option!]

                               

                              app.doScript("main()", ScriptLanguage.javascript, undefined, UndoModes.FAST_ENTIRE_SCRIPT, "Resize and Distribute! …");  
                                
                              function main()  
                              {  
                                  var myDoc = app.activeDocument;  
                                  var mySel = app.selection;  
                                
                                  if (mySel.length == 0)  exit();  
                                  else {  
                                      var myGroup = myDoc.groups.add(mySel);     
                                      var myGB = myGroup.geometricBounds;  
                                      myGroup.ungroup();
                                      //---------------------------------- ENTER SPACE (mm) ---------------------------
                                      var mySpace = 4;
                                      var myCalculationW = (myGB[3] - myGB[1] - (((mySel.length) - 1) * mySpace))/(mySel.length) + "mm";
                                      var myNewWidth = UnitValue(myCalculationW).as('pt'); 
                                        
                                      for (i = 0; i < mySel.length; i++) {  
                                          var mySelGB = mySel[i].geometricBounds;  
                                          var myCalculationH = (mySelGB[2] - mySelGB[0]) + "mm";
                                          var myCurrentHeight = UnitValue(myCalculationH).as('pt'); 
                              
                              
                                          if (mySel[i].geometricBounds[1] == myGB[1])  mySel[i].resize(CoordinateSpaces.INNER_COORDINATES, AnchorPoint.LEFT_CENTER_ANCHOR, ResizeMethods.REPLACING_CURRENT_DIMENSIONS_WITH, [myNewWidth, myCurrentHeight]);  
                                          if (mySel[i].geometricBounds[3] == myGB[3])  mySel[i].resize(CoordinateSpaces.INNER_COORDINATES, AnchorPoint.RIGHT_CENTER_ANCHOR, ResizeMethods.REPLACING_CURRENT_DIMENSIONS_WITH, [myNewWidth, myCurrentHeight]);  
                                          mySel[i].resize(CoordinateSpaces.INNER_COORDINATES, AnchorPoint.CENTER_ANCHOR, ResizeMethods.REPLACING_CURRENT_DIMENSIONS_WITH, [myNewWidth, myCurrentHeight]);  
                                      }  
                                      myDoc.distribute(mySel, DistributeOptions.HORIZONTAL_SPACE, AlignDistributeBounds.ITEM_BOUNDS);
                                      myDoc.align(mySel, AlignOptions.TOP_EDGES, AlignDistributeBounds.ITEM_BOUNDS);  
                                  }  
                              }
                              

                               

                              If 1 click is too much for you, that means you're much lazier than me! 

                               

                              (^/)

                              • 12. Re: Resizing in Indesign
                                Obi-wan Kenobi Adobe Community Professional

                                Always for Fun! 

                                 

                                Width and Space equal in the original area! and gift: we choose the new height!

                                Capture d’écran 2016-11-15 à 20.09.50.png

                                Capture d’écran 2016-11-15 à 20.57.03.png

                                app.doScript("main()", ScriptLanguage.javascript, undefined, UndoModes.FAST_ENTIRE_SCRIPT, "Resize and Distribute! …");  
                                  
                                function main()  
                                {  
                                    var myDoc = app.activeDocument;  
                                    var mySel = app.selection;  
                                  
                                    if (mySel.length == 0)  exit();  
                                    else {  
                                        var myGroup = myDoc.groups.add(mySel);     
                                        var myGB = myGroup.geometricBounds;  
                                        myGroup.ungroup();  
                                        var myCalculation = (myGB[3] - myGB[1])/((mySel.length * 2) - 1) + "mm";
                                        var myNewWidth = UnitValue(myCalculation).as('pt');  
                                        var myNewHeight = UnitValue('5mm').as('pt');  
                                          
                                        for (i = 0; i < mySel.length; i++) {  
                                            if (mySel[i].geometricBounds[1] == myGB[1])  mySel[i].resize(CoordinateSpaces.INNER_COORDINATES, AnchorPoint.LEFT_CENTER_ANCHOR, ResizeMethods.REPLACING_CURRENT_DIMENSIONS_WITH, [myNewWidth, myNewHeight]);  
                                            if (mySel[i].geometricBounds[3] == myGB[3])  mySel[i].resize(CoordinateSpaces.INNER_COORDINATES, AnchorPoint.RIGHT_CENTER_ANCHOR, ResizeMethods.REPLACING_CURRENT_DIMENSIONS_WITH, [myNewWidth, myNewHeight]);  
                                            mySel[i].resize(CoordinateSpaces.INNER_COORDINATES, AnchorPoint.CENTER_ANCHOR, ResizeMethods.REPLACING_CURRENT_DIMENSIONS_WITH, [myNewWidth, myNewHeight]);  
                                        }  
                                        myDoc.distribute(mySel, DistributeOptions.HORIZONTAL_SPACE, AlignDistributeBounds.ITEM_BOUNDS);
                                        myDoc.align(mySel, AlignOptions.TOP_EDGES, AlignDistributeBounds.ITEM_BOUNDS);  
                                    }  
                                }
                                

                                 

                                (^/)

                                • 13. Re: Resizing in Indesign
                                  Steve Werner Adobe Community Professional & MVP

                                  I agree with John Mensinger. You may get Obi-wan to whip up a script for you, but you're advised to learn the way the program really works out of the box. Unless you want to learn to write JavaScript programs (more power to you if you do!), you won't always have someone around to make one up. Better to learn how to work fast with the tools that are already there.

                                  • 14. Re: Resizing in Indesign
                                    Obi-wan Kenobi Adobe Community Professional

                                    Humm! …   Without disturbing, could I have the "10 points"? Thanks! 

                                     

                                    Siwybiwy, now that it is written, use the script! (even if you don't understand it)! 

                                    • 15. Re: Resizing in Indesign
                                      siwybiwy Level 1

                                      Thanks Steve, I know all the tricks of alignment and distribution. What inspired me to ask about this is the way ID recalculates the widths of a group of objects when you select and drag one of the handles. Wouldn't it be cool to have an extra control feature that makes them all the same width as you drag? For example, command-control-drag?

                                      • 16. Re: Resizing in Indesign
                                        siwybiwy Level 1

                                        I gave a simple example. Things can get more complicated with more objects. We all know how to use simple math with alignment and distribution commands in Indesign. I want a simple command that does it in a second. Select all, make them all the same width with a random gap. After that I can select them all and drag to desired width as a group, where the gap will be maintained the same, as will the same widths of the objects.

                                        • 17. Re: Resizing in Indesign
                                          siwybiwy Level 1

                                          Obi Wan, 10 points. I want this included in InDesign by default!

                                          • 18. Re: Resizing in Indesign
                                            Obi-wan Kenobi Adobe Community Professional

                                            Too specific! 

                                             

                                            (^/)

                                            • 19. Re: Resizing in Indesign
                                              John Mensinger Adobe Community Professional & MVP

                                              siwybiwy wrote:

                                               

                                              We all know how to use simple math with alignment and distribution commands in Indesign.

                                              Well, I wouldn't assume "we all" do, and your first few posts didn't make it obvious that you did.

                                              I want a simple command that does it in a second. Select all, make them all the same width with a random gap.

                                              I guess we all want what we want. Wait, now it's a random gap? Hmm...the way so many use the word "random" wrongly now, I have to ask; do you mean random spacing, or equal spacing of a value that's chosen at random? Frankly, I'm not sure either one makes any sense with respect to software function or page layout.

                                              After that I can select them all and drag to desired width as a group, where the gap will be maintained the same, as will the same widths of the objects.

                                              So you'll resize the group without the size of the objects or the size of the gaps changing? I don't think any amount of Ctrl+drag will ever accomplish that. Ah, I suppose you mean the size of the objects will increase or decrease, but remain equal to each other. I had to reread.

                                               

                                              Funny, as much as you would see this as a useful feature, it's a prime example of the type of automatic feature-trick I personally wouldn't want. I prefer that software responds only to my discreet and explicit input, one concept at a time. It helps keep things from happening "accidentally." When you do want multiple concepts executed concurrently or in sequence, scripting comes into play, as this thread and Obi-wan's solution demonstrate perfectly.

                                              • 20. Re: Resizing in Indesign
                                                siwybiwy Level 1

                                                Nobody needs to explain that he or she CAN use simple math in Indesign, surely.

                                                 

                                                Random gap means any gap that is consistent/same between the objects.

                                                 

                                                Let me explain. You take the group (of x width), made even with Obi-wan script, to your chosen group width (y) by dragging the handle of the group selection, and applying the script again to get the old gap back.

                                                 

                                                I'm sorry you don't find it useful, but I am also sure you'll keep it safely in your script folder .

                                                Screen Shot 2016-11-16 at 11.48.24.png

                                                • 21. Re: Resizing in Indesign
                                                  John Mensinger Adobe Community Professional & MVP

                                                  siwybiwy wrote:

                                                   

                                                  Nobody needs to explain that he or she CAN use simple math in Indesign, surely.

                                                  Hah. You're right; either way, it often doesn't need to be explained.

                                                  Random gap means any gap that is consistent/same between the objects.

                                                  I know this is strictly arguing the semantics of it, but it's one of the reasons you got the mistaken impression I had trouble understanding exactly what you wanted. A value (the gap) that is mathematically determined by other non-random factors, as in this case, is not random. For some reason the word has wrongly come to mean "not predetermined;" but random actually means not determined at all, or more accurately, determined by the laws of accident.

                                                  Let me explain.

                                                  No need. I understood exactly what you wanted, with respect to functionality, since the beginning of the thread. Any misunderstanding on my part was borne of asking "why?"  and "how?" more so than "what?" Or perhaps is was in my misinterpretation of your original question; "Can I do this in InDesign?" In retrospect I'd have done better to understand it as "Can InDesign do this on my terms?"

                                                  I'm sorry you don't find it useful...

                                                  Again, no need. We all have our own ways of working, and if it's useful to you, then I'm glad you were able to get what you wanted in some form.

                                                  • 22. Re: Resizing in Indesign
                                                    siwybiwy Level 1

                                                    Cool reply, thank you for your interest in this.