Skip to main content
Per Berntsen
Community Expert
Community Expert
October 28, 2008
Question

CS4 - script to set Zoom Level?

  • October 28, 2008
  • 6 replies
  • 909 views
I just upgraded from CS to CS4, and in CS it was possible to access the zoom level box with a keyboard shortcut, I could then type in a value. In CS4, this box is no longer accessible via the keyboard. I use this quite a lot, because at 130%, the document appears at the printed size. I found this workflow less than perfect in CS, and even more so in CS4, because I have to use the mouse as well.

Would it be possible to write a script that sets the document magnification to 130% ? I have to admit that I know nothing about scripting ...
This topic has been closed for replies.

6 replies

Per Berntsen
Community Expert
Community Expert
October 29, 2008
The correct filepath was C:\Documents and Settings\username\Application Data\Adobe\InDesign\Version 6.0\en_GB\Scripts\Scripts Panel (!)
Anyway,
>app.activeWindow.zoomPercentage = 130;

works. Thanks to both of you!
Inspiring
October 28, 2008
Oh! That's what Jongware told you. Well. That's the way to do it. Trying to remember the filepath is murder.

Dave
Inspiring
October 28, 2008
To find the location in CS4, open the Scripts Panel and then right-click on the User folder. Choose Reveal in Finder (or whatever it's called on Windows) and there is the folder to hold your scripts. They need to be inside the Scripts Panel folder.

Dave
Jongware
Community Expert
Community Expert
October 28, 2008
It's a single liner, yes. Copy it into a plain text file and save this as "zoom.jsx" (you got that right, so far) into the correct folder. Now, where that is ... I don't know the location of scripts in CS4, but you can click-right onto the "User" folder in the Scripts panel and select "Open in Explorer|Open in Finder". Then put the script in the folder "User" you see there.

(Anyone with CS4, don't hesitate to step in, although this really should work now!)

And that first line worked fine for me in plain old CS, the 2nd did nothing -- not even an error. Oh well.
Per Berntsen
Community Expert
Community Expert
October 28, 2008
I tried both, but they won't even show up in the Scripts panel. I saved as .jsx in both C:\Documents and Settings\username\My Documents\Adobe Scripts and C:\Program Files\Adobe\Adobe InDesign CS4\Scripts.

Is this single line all there is to it? Remember I'm new to scripting. Thanks.
Jongware
Community Expert
Community Expert
October 28, 2008
Try

>app.activeWindow.zoomPercentage = 130;

or -- only if that doesn't work --

>app.activeDocument.windows[0].zoomPercentage = 130;

It will fail miserably if you try this on a Story window. That can be worked around, but it's easier to just don't do that.

You can set a hotkey to the script in the Keyboard Shortcut Editor (if that's still there in CS4).