-
1. Re: changing preset zoom increments
Peter Spier Sep 22, 2011 6:24 AM (in response to Fritz Hansen)1 person found this helpfulThe only way to customize zoom values is through scripting ( if you search, you should be able to find Dave Saunders' script to set the zoom for an accurate 100% view, which you can modify to have any percentage of your choosing). You can then assign a keyboard shortcut to the script, but you'd need a separate script/shortcut for each percentage you choose -- the Cmd (Ctrl) +/- shortcuts to zoom in or out won't use the custom values.
-
2. Re: changing preset zoom increments
TᴀW Sep 22, 2011 8:01 AM (in response to Peter Spier)1 person found this helpfulPeter, It should be possible to redefine those shortcut keys to run a
script (well, 2 different scripts, I guess) which will either increase
or decrease the the zoom to a set of predefined values.
-
3. Re: changing preset zoom increments
John Hawkinson Sep 22, 2011 8:36 AM (in response to TᴀW)Everybody's right!
It's a one-line script to set the zoom percentage of the active window. If you want to bind them to discrete keys, i.e. Cmd-1, Cmd-2, Cmd-4, you'll need 3 or 4 different scripts, one for each percentage.
But yes, you could redefine the Cmd +/- shortcuts to a slightly more complicated script that checks the current value of the zoom for the active window and then increases or decreases it according to a rule of your own choosing.
It's not feasible to use these methods to change the behavior the actual zoom tool, though, only the keyboard shortcuts. Honestly, I usually just use the marquee zoom feature to drag a box around what I want. That way I get near perfect zooming every time.
-
4. Re: changing preset zoom increments
TᴀW Sep 22, 2011 11:24 AM (in response to John Hawkinson)Here's my attempt at a script to do this:
/*
Custom Zoom Percentages
An InDesign CS4 script (c) Ariel Walden, FreelanceBookDesign.com, 2011
To use: Add, remove or change the list of numbers between square
brackets (zooms = ) to whichever zoom percentages you like.
IMPORTANT:
(1) Make sure your zoom percentages are in ascending order!
(2) Make sure they are separated by a comma!
*/
try{
theWindow = app.activeWindow;
reset = true;
currentZoom = theWindow.zoomPercentage;
for (i=0; i<zooms.length; i++){
if (currentZoom < zooms[i]){
newZoom = zooms[i];
reset = false;
break;
}
}
if (reset) newZoom = zooms[0];
theWindow.zoomPercentage = newZoom;
}
catch(e){}
I work on CS4, so it's tested on that. Does it work in other versions?
The script will cycle through the predefined zoom percentages, and when
it reaches the end it will jump back to the smallest. This will save the
need for two scripts (one to go up and one to go down) for some people.
Thanks,
Ariel
-
5. Re: changing preset zoom increments
John Hawkinson Sep 22, 2011 11:35 AM (in response to TᴀW)Ariel: Something horrible horrible has happened to the arrays in your post. Did you use the email interface? [I hope so, because otherwise there's a very serious new bug in the new version of the forum]: All of your arrays, in brackets, turned into URLs, to which the base URL for this thread was prepended. Can you edit your post online to fix them?
Incidently, I would suggest that instead of listing "IMPORTANT: (1) Make sure your zoom percentages are in ascending order!" that you just use:
zooms = [20,40,60,100,160,260,420,680].sort();
so that it is a non-issue.
-
-
7. Re: changing preset zoom increments
TᴀW Sep 22, 2011 12:53 PM (in response to John Hawkinson)(Incidentally, if anyone would like to PM me about the script -- and get
an answer before tomorrow(!) -- I'm only reachable on bookraft (at)
googlemail.com right now.)
-
8. Re: changing preset zoom increments
Peter Spier Sep 22, 2011 1:34 PM (in response to TᴀW)Ariel, another empty post in response to John....
I suspect it's quotes in your emails and Jive playing games.
-
9. Re: changing preset zoom increments
John Hawkinson Sep 22, 2011 1:36 PM (in response to Peter Spier)OK, I corresponded with Ariel offline, and s/he writes:
Oh dear, sorry about the arrays. I did send this in by email, and I won't
have access to the web until tomorrow to fix it. If you feel like
reposting a corrected version meanwhile go ahead.
I wonder if there's a way of adding tags to an email response to get the
forum to format something as javascript (similar to the online option)?
Good catch about using sort()!
Ariel
Upon request, I repost the revised script:
/* Custom Zoom Percentages An InDesign CS4 script (c) Ariel Walden, FreelanceBookDesign.com, 2011 To use: Add, remove or change the list of numbers between square brackets (zooms = [x, y, z, etc.]) to whichever zoom percentages you like. IMPORTANT: Make sure they are separated by a comma! */ try{ zooms = [20,40,60,100,160,260,420,680].sort(); theWindow = app.activeWindow; reset = true; currentZoom = theWindow.zoomPercentage; for (i=0; i<zooms.length; i++){ if (currentZoom < zooms[i]){ newZoom = zooms[i]; reset = false; break; } } if (reset) newZoom = zooms[0]; theWindow.zoomPercentage = newZoom; } catch(e){}
-
10. Re: changing preset zoom increments
Peter Spier Sep 22, 2011 1:43 PM (in response to John Hawkinson)Thanks, John.
And Ariel is a He as far as I know.
-
11. Re: changing preset zoom increments
TᴀW Sep 22, 2011 2:13 PM (in response to John Hawkinson)Thanks, John.
Ariel, esq.
-
12. Re: changing preset zoom increments
Fritz Hansen Sep 23, 2011 7:01 AM (in response to Peter Spier)Thanks to all who responded. The scripting route seems a bit much for my needs, but I may try it. Setting the maginfication manually would be fine if my Apple wireless "super" mouse wouldn't be so sensitive and suddenly zoom way out or way in just because I happened to brush my fingers the wrong way with the option key held down.
-
13. Re: changing preset zoom increments
John Hawkinson Sep 23, 2011 7:06 AM (in response to Fritz Hansen)Fritz:
The scripting route seems a bit much for my needs, but I may try it.
Since Ariel took the time to actually write the script for you, I strongly encourage you to try it! All the hard work is done, you just need to install it. (Save it as customZoomPercentages.jsx as a plain text file, not RTF, in a text editor, such as Notepad or TextEdit, and follow the instructions at http://www.danrodney.com/scripts/directions-installingscripts.html. Then bind it to a key in Edit > Keyboard Shortcuts under Scripts.
(I know if I wrote a script for someone, I'd be kind of bummed if they didn't even try it!)
-
14. Re: changing preset zoom increments
Fritz Hansen Dec 22, 2011 7:31 AM (in response to John Hawkinson)Just reviewing some of my posts and saw this. I completely agree with you and will indeed try it. Thanks for the polite nudge. I may even learn something about scripting. And apologies to Ariel for appearing dismissive of her efforts.
-
15. Re: changing preset zoom increments
Peter Spier Dec 22, 2011 8:11 AM (in response to Fritz Hansen)Ariel, like former Israeli Prime Minister Ariel Sharon, is a man, for future reference.
-
16. Re: changing preset zoom increments
Fritz Hansen Dec 22, 2011 8:14 AM (in response to Peter Spier)OK. Noted. My further apologies to Ariel.
-
17. Re: changing preset zoom increments
bttrflygrl Apr 10, 2012 7:58 AM (in response to Fritz Hansen)Does this script work for Photoshop CS5 as well? I've never used scripts, but I have a need for a very specific preset zoom value or a quick shortcut to take me to an odd zoom level (38.5%) Thanks!
Debbie
-
18. Re: changing preset zoom increments
[Jongware] Apr 10, 2012 8:19 AM (in response to bttrflygrl)Debbie, there are some similarities between scripting for InDesign and for Photoshop, but only because both use the same language (Javascript). But there are vast differences in the Document Object Model -- the 'words' that you use to interrogate and command InDesign and Photoshop.
The chance that this very same script, written especially for InDesign, works for Photoshop as well is extremely minimal. Even if it does, it'd be by pure chance alone, rather than by design or intention.
But you could ask in the Photoshop scripting forum if there is something similar, or even if Ariël's script can be re-worked for PS.
-
19. Re: changing preset zoom increments
getho Dec 23, 2012 3:15 PM (in response to [Jongware])just stumbled on this old thread (I found the default zooms must've changed between cs5 and cs6 because I take screen shots of a layout I regularly do and they are now eiither too big or too small). In Cs6 on windows I couldn't get the script to work - either zooming with the zoom tool or with keyboard (ctrl +/_). the script is insale din the application folder. When I run the script it jumps the active document to 99% soom.
-
20. Re: changing preset zoom increments
John Hawkinson Dec 23, 2012 4:13 PM (in response to getho)Did you try the version of the script I posted in post #9? Note that the script does not change the behavior of the zoom tool, nor of Ctrl+-/-. You'll need to run the script (double click) it to change the zoom. Run it repeatedly to cycle through the set of zooms.
Assuming that works, than you can use Edit > Keyboard Shortcuts to set a key to tun the script (and that could be Ctrl + if you like).
In CS6, the standard of comparisons for zooms changed. 100% zoom now factors into account your screen's physical size, so it looks larger than it did in CS5 (substantially so).
-
21. Re: changing preset zoom increments
getho Jan 28, 2013 6:06 PM (in response to John Hawkinson)Hi John,
sorry for delay there - christmas happened! thanks for the info re cs6 sizing - I was wondering what had changed
yes just double checked its the right version.
double clicking the script in the user folder of the script panel still makes it jump to 99%, subsequent double clicks dont do anything.
I found this page: http://indesignsecrets.com/custom-zoommagnification-settings-in-indesign.php
So I tried chaging the do something bit to: app.layoutWindows[0].zoomPercentage = newZoom;
And a few other hacks (I dont really know what I'm doing), and I stuck an alert in to report the value of newzoom. It kept reporting 100. So I took out the if (currentZoom < zooms[i]) test and it cycled through all the available values (but seemingly randomly) before ending at 680. ACtually the sort is sorting them like this:
100,160,20,260,40,420,60,680
So its sorting them sort of alphabetically! And it explains why it is zooming to 100 first.
-
22. Re: changing preset zoom increments
John Hawkinson Jan 28, 2013 6:14 PM (in response to getho)100,160,20,260,40,420,60,680
So its sorting them sort of alphabetically! And it explains why it is zooming to 100 first.
How embarassing!
Indeed, JavaScript's sort is lexicographic not numeric.
You could fix this with
[20,40,60,100,160,260,420,680].sort(function(a,b) { return a-b; });
but it might not be worth the trouble...
-
23. Re: changing preset zoom increments
getho Feb 4, 2013 12:45 AM (in response to John Hawkinson)Hi John
does this actually work for you though - because when I said it was cycling through the values it was only in an alert that I inserted, it sill wouldn't zoom at all.
-
24. Re: changing preset zoom increments
[Jongware] Feb 4, 2013 1:48 AM (in response to getho)Just in case you changed a bit too much in Ariël's original script, here is the amended version (it appears to me it works as it's supposed to):
/* Custom Zoom Percentages An InDesign CS4 script (c) Ariel Walden, FreelanceBookDesign.com, 2011 To use: Add, remove or change the list of numbers between square brackets (zooms = [x, y, z, etc.]) to whichever zoom percentages you like. IMPORTANT: Make sure they are separated by a comma! */ try{ zooms = [20,40,60,100,160,260,420,680].sort(function(a,b) { return a-b; }); theWindow = app.activeWindow; reset = true; currentZoom = theWindow.zoomPercentage; for (i=0; i<zooms.length; i++){ if (currentZoom < zooms[i]){ newZoom = zooms[i]; reset = false; break; } } if (reset) newZoom = zooms[0]; theWindow.zoomPercentage = newZoom; } catch(e){}
-
25. Re: changing preset zoom increments
getho Feb 12, 2013 6:21 PM (in response to [Jongware])thanks
on cs6 it works for 4 goes, then stops!? Just tried changing the values and it now only zooms the first increment.
AH I see whats happening - with the default values its zooming 20,40,60,99. AS soon as it hits a non-round zoom value its crapping out.
ah well its frustrating but I've found this little script which is doing what I need:
try {app.layoutWindows[0].zoom(ZoomOptions.FIT_PAGE);
app.layoutWindows[0].zoomPercentage = Number(app.activeScript.name.match(/\d+/)[0]);} catch (e) {};
it zooms the amount in the name of the script: eg zoom65.jsx
-
26. Re: changing preset zoom increments
[Jongware] Feb 13, 2013 3:26 AM (in response to getho)Getho, that's really strange. It works on CS4, even with 'non-round' values such as 99% and 101%. I cannot imagine it would work any different for CS6 -- but I'll try it at home tonight, where I have CS6 installed.
getho wrote:
.. it zooms the amount in the name of the script: eg zoom65.jsx
Yeah, one of my brighter ideas
-
27. Re: changing preset zoom increments
davidhmorgan May 23, 2017 8:56 PM (in response to Fritz Hansen)I wrote an AppleScript that changes the zoom increment from 25% to 5%.
When using the shortcut (command plus) or (command minus), the zoom is increased or decreased by 25% (or 25 percentage points to be precise). Personally I find this too great a difference and I'm always changing from either to big or too small. These two scripts can be used to replace the default behaviour – assign them the same shortcuts - command + and command - to make the zoom increment by 5%.
Download them from here: http://www.drscripto.com/?p=862
otherwise the code is simple:
tell window 1 of application "Adobe InDesign CC 2017"
try
set InitialZoom to zoom percentage
set NewZoom to InitialZoom + 5
set zoom percentage to NewZoom
end try
end tell