25 Replies Latest reply on Mar 11, 2013 3:31 PM by Laubender

    Changing the keyboard increment when...

    Joe Duhamel Level 1

      I would like to change the keyboard increment when attmpting to increase/decrease the size of an image using command-option-< and >

       

      Currently it jumps in the oddest incrememnt, not even a whole number. Increasing the size from 100% makes the result 105.10100501000001% Where does THAT come from?

       

      I'd like to be able to change it, to, say, 5% increments or 2% increments. Any guesses?

        • 1. Re: Changing the keyboard increment when...
          Peter Spier Most Valuable Participant (Moderator)

          What version of ID are you using, and what OS?

          • 2. Re: Changing the keyboard increment when...
            Joe Duhamel Level 1

            Does that even matter?

             

            ID 5.5 and 6

             

            The OS is Mac (command-option should have given that away), 10.8.2

            • 3. Re: Changing the keyboard increment when...
              Steve Werner Adobe Community Professional & MVP

              According to the built-in keyboard shortcuts, when you scale objects with keystrokes (Product Area: Object Editing), these are hard-wired. On a Mac, they are:

               

              Increase scale by 1% --- Default: Cmd+.

              Increase scale by 5% --- Default: Opt+Cmd+.

               

              The keyboard increments that are editable in Preferences > Units and Increments are cursor key movement, baseline shift for type, size/leading for type, and kerning/tracking for type.

               

              And I get the same small "rounding error" on my Mac in OS X 10.8.2 with the increase by 5%:

               

              100% becomes 105.1010...%

              • 4. Re: Changing the keyboard increment when...
                Peter Spier Most Valuable Participant (Moderator)

                Hmmmmm.

                 

                I'm seeing the same thing here in Windows 7 from CS4 forward.

                • 5. Re: Changing the keyboard increment when...
                  Joe Duhamel Level 1

                  Thanks, but neither of those work. Command + does nothing. Command-Option + zooms in as a video effect (like Control-wheel). Command + on the keypad zooms in as in the View > Zoom In command.

                  • 6. Re: Changing the keyboard increment when...
                    Peter Spier Most Valuable Participant (Moderator)

                    I was going to say it looks like a change in the algorithm, and that it's doing a recursive multiply in 1% steps, but that isn't it, either.

                    • 7. Re: Changing the keyboard increment when...
                      Peter Spier Most Valuable Participant (Moderator)

                      That's Cmd + . or Cmd + Opt + . (the period). Easier to think of that as the > key in this case, and instead of , (comma) for going the other direction, think of <.

                      • 8. Re: Changing the keyboard increment when...
                        Joe Duhamel Level 1

                        Oh, duh. LOL... Yes, that works! Well, the 1% icrement does. But it's still not right. Hitting it twice results in 102.01%, rather than 102% solid. An acceptable anomaly at this point. But it's obviously not a solid amount and that's very weird. Thanks guys!

                        • 9. Re: Changing the keyboard increment when...
                          Peter Spier Most Valuable Participant (Moderator)

                          Actually, it IS the recursive multiplication. I was doing 1.1 instead of 1.01 on the calculator a few minutes ago.

                          • 10. Re: Changing the keyboard increment when...
                            Joe Duhamel Level 1

                            Okay, but what is the point of that? Why recursive?

                            • 11. Re: Changing the keyboard increment when...
                              Peter Spier Most Valuable Participant (Moderator)

                              You'd have to ask the engineers why. But waht it's doing is multiplying by 1.01 each time you hit the shorcut (or 5 times, for the larger jump), rather than taking the 100% dimension, calculating the percentage of that and adding it.

                               

                              I have som vague memories of someone, Sandee Cohen, I think, complaining about this new behavior when it changed, and somebody else writing a script to emulate the old method, but I don't know that I have the script.

                              • 12. Re: Changing the keyboard increment when...
                                Steve Werner Adobe Community Professional & MVP

                                A Google search turns up this previous discussion and a link to the script:

                                 

                                http://forums.adobe.com/message/2313057?tstart=0

                                • 13. Re: Changing the keyboard increment when...
                                  Laubender Adobe Community Professional & MVP

                                  @Steve – as far as I can see right now, the mentioned script will not work as expected.
                                  At least in my version of InDesign (CS5.5 v7.5.3).

                                  Something is deeply wrong. The script goes back to InDesign CS3, I think. And things obviously have changed (again) since then…

                                   

                                  So with the script I get the same results like hitting the keyboard shortcuts:

                                   

                                  Example with "scale up by 1percent.jsx" on a selected rectangle that holds an image placed with 100%:

                                   

                                  1. result 101%

                                  2. result 102.01 %

                                  3. result 103.0301 %

                                   

                                  My conclusion: the script is using an "outdated" method of scaling.

                                   

                                  I have to investigate further…

                                  I'll be back soon to publish a script that will work. It will use a transformation matrix.

                                   

                                  Just have to do some further testing.
                                  Basically with two states an InDesign document can handle scaling (defined at preferences):

                                   

                                  1. Apply to Content
                                  2. Adjust Scaling Percentage

                                   

                                  I prefer no. 1.

                                   

                                  And, as I can already see,  my script will  work with both options, but the right values can only be seen after you redefine the scaling to 100% with the Transformation Panel…

                                   

                                  Of course, I can easily implement this in the script.
                                  But the question is: should I?
                                  Does the user make good use of not using option 1 in the preferences and stays with "Adjust Scaling Percentage"?

                                   

                                   

                                  My script will have some extra features (opposed to the old one):

                                   

                                  1. undo in one go
                                  2. will not scale objects that have no graphics
                                  3. will not give an error if locked objects are selected

                                   

                                  It will work in InDesign CS4 and above.
                                  But again: I have to test that…

                                   

                                  Uwe

                                  • 14. Re: Changing the keyboard increment when...
                                    Laubender Adobe Community Professional & MVP

                                    Oh. And please comment on the "extra" feature list. Maybe you WANT to scale all selected objects? Also the locked ones?
                                    That may depend on your individual use case…

                                     

                                    Uwe

                                    • 15. Re: Changing the keyboard increment when...
                                      [Jongware] Most Valuable Participant

                                      Uwe, would this script only be used on frames containing an image? The concept of 'scale' is a bit hazy for regular rectangles -- maybe that's why ID always reports '100%', whatever you size them to. So, scaling up by 1% twice is not double that of the original size -- it's a kind of Compound Interest thing.

                                       

                                      If you want to scale an "image" up by 1% (both the image and its frame), you need to jump through some hoops. Without trying it myself: (a) read original image scale, (b) add 1% to it, (c) add 1/(old_image_scale) to the frame's scale. I'm not too sure that's the right way to do it and worse: I don't know what scaling the frame and image independently of each other will do with the image position inside the frame.

                                      • 16. Re: Changing the keyboard increment when...
                                        Peter Spier Most Valuable Participant (Moderator)

                                        Uwe,

                                         

                                        Were you still using the keyboard shortcuts? Did you reassigne them to run the scripts? I just installed them in CS6 in a Version 6.0 Scripts subfolder and they work as I would expect from the scripts panel. I didn't make a new set of KB shortcuts, nor test them loose.

                                        • 17. Re: Changing the keyboard increment when...
                                          Laubender Adobe Community Professional & MVP

                                          @Peter – I did not test with InDesign CS6, just CS5.5. I just doubleclicked in the Scripts Panel.
                                          And my preferences were set to:

                                           

                                          Scaling: Apply to Contents

                                           

                                          Maybe this is just a CS5.5 issue. Had no time for further testing…

                                           

                                          @Jongware –  finished one script, but did not test much.
                                          The one that just scales frames + contents in increments of 1%, if contents is a graphic.

                                           

                                          See for yourself:

                                           

                                           

                                          //ScaleUP_by_increment_of_ONE_Percent_WITH_TRANSFORMATIONMATRIX.jsx
                                          //Uwe Laubender
                                          
                                          
                                          /**
                                          * @@@BUILDINFO@@@ ScaleUP_by_increment_of_ONE_Percent_WITH_TRANSFORMATIONMATRIX.jsx !Version! Mon Mar 11 2013 11:51:54 GMT+0100
                                          */
                                          
                                          //DESCRIPTION: Step of scaling UP: 1%
                                          
                                          app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;
                                          
                                          app.doScript(_ScaleGraphicsOfSelection, ScriptLanguage.JAVASCRIPT, [], UndoModes.ENTIRE_SCRIPT, "Scale All Graphics of Selection: UP BY 1 PERCENT");
                                          
                                          
                                          
                                          function _ScaleGraphicsOfSelection(){
                                          
                                          var percentage = 1; //You can change the amount here
                                          
                                          var sel = app.selection;
                                          
                                          if(sel.length === 0){alert("There is nothing selected! Try again…");exit(0);};
                                          
                                          for(var n=0;n<sel.length;n++){
                                              
                                              //Check, if the individual selected object is of type "Rectangle", "Oval" or "Polygon".
                                              //AND check, if the individual selected object has a graphic (objects without graphics should not be scaled!).
                                              //AND check, if the individual selected object is locked => we will not unlock the object to scale it.
                                              
                                              if(sel[n].constructor.name == "Rectangle" 
                                                  || sel[n].constructor.name == "Oval" 
                                                  || sel[n].constructor.name == "Polygon" 
                                                  && app.selection[n].graphics[0].isValid 
                                                  && app.selection[n].locked == false
                                                  ){
                                                  
                                                  var currObject = sel[n];
                                          
                                                  var currHScaleGraphic = currObject.graphics[0].horizontalScale;
                                                  var currVScaleGraphic =currObject.graphics[0].verticalScale;
                                          
                                                  var HFactor = ((currHScaleGraphic +percentage) / currHScaleGraphic);
                                                  var VFactor = ((currVScaleGraphic +percentage) / currVScaleGraphic);
                                          
                                          
                                                  var newTM = app.transformationMatrices.add({horizontalScaleFactor: HFactor, verticalScaleFactor: VFactor});
                                          
                                                  currObject.transform(CoordinateSpaces.INNER_COORDINATES, AnchorPoint.CENTER_ANCHOR, newTM);
                                                  
                                                  //OPTIONAL:
                                                  currObject.redefineScaling();
                                                  
                                                  };
                                              };
                                          
                                          }; //END function "_ScaleGraphicsOfSelection()";
                                          

                                           

                                          Uwe

                                          • 18. Re: Changing the keyboard increment when...
                                            Peter Spier Most Valuable Participant (Moderator)

                                            You do get different results depending on if you choose the frame or the content. If the content is chosen, the script will smoothly scale in 1% increments.

                                             

                                            On the other hand, if you choose the frame, you are scaling the frame and content together, so you scale the frame itself in smooth 1% increments, but you are also scaling the scaled content by 1%, which is the same thing that the keybaord shorcut does if you select the content and not the frame, if that's clear. This is, in my opinion, what users should expect when the preference is set to apply to content. There is not a direct relationship at any particular time between the frame size (which is always 100% in this scenario) and the scale of the content.

                                             

                                            This is a different behavior, though than I see in CS3 (and I think it changed in CS4, but haven't taken the time to confirm). In CS3 when I use the keybaord shortcut with the frame selected, only the frame scales, not the content. Im CS6 both are scaling in tandem. I have apply to content set in the prefs in both versions. The scripts seem to work identically in both versions.

                                            • 19. Re: Changing the keyboard increment when...
                                              Laubender Adobe Community Professional & MVP

                                              @Peter – just to make that clear:
                                              are you talking about the "old" script set Steve Werner has pointed to?

                                               

                                              I must admit, that I'm a little confused right now.
                                              Have to find time for further testing.

                                               

                                              Uwe

                                              • 20. Re: Changing the keyboard increment when...
                                                Peter Spier Most Valuable Participant (Moderator)

                                                Yes, the scripts from Steve's link. I don't have yours installed. I was responding to your assertion that they did not work, and I think that they actually do work as they are intended -- again given the difference between scaling the frame and content, or just the content.

                                                 

                                                My contention is that if you were NOT to multiply the content scale by 1.01 when scaling the frame, but rather add 1% to the content scale, you would be affecting the fit (that's what happens in CS3 with the keyboard shortcuts since the content does not scale withthe frame) and would ultimately either crop the image or leave white space around it.

                                                • 21. Re: Changing the keyboard increment when...
                                                  Laubender Adobe Community Professional & MVP

                                                  Ok then.

                                                   

                                                  My observation using the scripts from Steve's link is (CS3, CS4, CS5, CS5.5), that if you use the script repeatedly with an image container selected AND your scaling preferences are set to "Apply to Contents", the image is not scaled to exact percentages (100 => 101 => 102 => 103), but to the odd amounts you see, if you use the keyboard shortcut cmd + . (100 => 101 => 102.01 => 103.0301 etc.)

                                                   

                                                  To get "real" 101, 102, 103 etc. percentage values for the image, you can select the image container and use my script on that.

                                                   

                                                  If you use the "old" script and change the scaling preferences to "Adjust Scaling Percentage", you'll see percentages like 101, 102, 103 etc. on the the container and 100% on the image itself. This result seems ok for me: In the moment you will apply "Redefine Scaling to 100%" from the Transformation Palette,  the container will get a 100% value, the image inside will change to 101, 102 or 103 % depending on how often you used the script.

                                                   

                                                  If you are using my script for this scenario AND do not include the optional line currObject.redefineScaling(); you will see no different result in both scripts.
                                                  If you leave the line included, you'll get a 100% container with 101, 102, 103 etc.

                                                   

                                                  In CS3 things are different.
                                                  There you can use the "old" script and get results like 101, 102, 103 etc. both on the container and the image, if you select the container when set the scaling preferences to "Adjust Scaling Percentage". Both, container and image are scaled in tandem, which is not possible with cmd + .

                                                   

                                                  I'm testing with InDesign CS3 (v5.0.4), CS4 (v6.0.6), CS5 (v7.0.4) and CS5.5 (v.7.5.3), all German on Mac OSX 10.6.8.

                                                   

                                                  Uwe

                                                   

                                                  Message was edited by: Laubender

                                                  • 22. Re: Changing the keyboard increment when...
                                                    Peter Spier Most Valuable Participant (Moderator)

                                                    I believe you and I are seeing the same thing with the old scripts.

                                                     

                                                    From what you are saying, I think also that your script does not scale the container in whole percentages, but scales the content in whole percentages, then adjusts the container to maintain the cropping, which is not necessarily an even percentage change on the size of the container. Is that essentially true?

                                                     

                                                    I don't think there's anything wrong with that approach, as long as it's understood, but I suspect if most users select a frame and increase the scale by 1% or 5% they expect the dimensions of the container to change by that much, and don't care if teh content is scaling to a different percentage, as long as the cropping does not change.

                                                    • 23. Re: Changing the keyboard increment when...
                                                      Laubender Adobe Community Professional & MVP

                                                      @Peter – with my script the container (together with the image) is scaled in one step. The amount is derived from the image. The cropping does not change, if the x and y scaling value of the image is the same… And if the image is not rotated.

                                                       

                                                      A few tests show, that if x and y resolution of the image is different, the script will scale according to both image scale percentages (that is by concept). And that, of course, is not the result I intended. Then the cropping does change. Left alone that the image percentages will be odd…


                                                      Other problem arise: rotated images…
                                                      The rotation angle will be changed, the shear angel (skew) will be changed as well…

                                                       

                                                      Ok. Points taken. Forget my script. I will rethink the whole thing.

                                                       

                                                      Uwe

                                                      • 24. Re: Changing the keyboard increment when...
                                                        Peter Spier Most Valuable Participant (Moderator)

                                                        Oh dear. I didn't mean to dump on your script. I just didn't understand why you thought the old scripts didn't work, and was trying to point out that they behaved as I would expect, given my own preferences for scaling behaviors depending on if I've selected the container or the content.

                                                         

                                                        As I said before, I think maybe your expectations for scaling when selecting the container are different from mine, and that's perfectly OK.

                                                        • 25. Re: Changing the keyboard increment when...
                                                          Laubender Adobe Community Professional & MVP

                                                          @Peter – no problem at all… :-)

                                                          But I will sleep it over. Tomorrow and the day after I'm already full with work for clients.
                                                          I will get back to scripting in about two days…

                                                           

                                                          Until then, have a good time!

                                                           

                                                          Uwe