Skip to main content
September 10, 2018
Question

Zoom to the selection

  • September 10, 2018
  • 1 reply
  • 3005 views

Hi Scripters,

I have been looking for a way to javascript the zoom to fit the selected objects into the window, I have looked through the zoom styles but cannot find one that does this. I have tried the "Fit Selection in Window" menu item in InDesign but this zooms out a lot further than the selection so is no good for what I need.

Does anyone have a one liner solution or can point me in the direction of a script that does this that I can edit to fit my needs?

Many Thanks in advance, Bren

This topic has been closed for replies.

1 reply

Legend
September 10, 2018

Fiddle with the zoomPercentage.

  app.activeDocument.layoutWindows[0].zoomPercentage = app.activeDocument.layoutWindows[0].zoomPercentage;

September 10, 2018

Thanks for the reply,

Unfortunately this does a fixed percentage zoom and doesn't take into account the size of my current selection which changes every time the script is run.

Bren

winterm
Legend
September 10, 2018

Well, I could imagine something working better than this, but didn't find yet…

in-tools.com/indesign/scripts/freeware/ZoomToWidth.jsx