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?
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...%
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!
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.
@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, 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.
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.
@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:
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.
@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.
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.
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.
Message was edited by: Laubender
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.
@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.
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.
@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!