Skip to main content
Inspiring
July 10, 2009
Question

Do I need a script to automate zoom levels?

  • July 10, 2009
  • 2 replies
  • 1985 views

During my typical workflow, I set various zoom levels at different points along the way. These zoom levels are all of the following:

Fit on Screen which is simple enough.

50%

75%

100%

150%

200%

300%

Why I need these specific zoom levels isn't important, but suffice it to say that based on my typical image sizes and screen size, those are what work best for me during my workflow.

Do I need a script or can this be accomplished with only actions?

Thank you.

This topic has been closed for replies.

2 replies

Inspiring
July 11, 2009

jugejury, thanks for you post.

function setZoom( zoom ) {// as percent
   cTID = function(s) { return app.charIDToTypeID(s); }; // from xbytor
   var docRes = activeDocument.resolution;
   activeDocument.resizeImage( undefined, undefined, 72/(zoom/100), ResampleMethod.NONE );
   var desc = new ActionDescriptor();
   var ref = new ActionReference();
   ref.putEnumerated( cTID( "Mn  " ), cTID( "MnIt" ), cTID( 'PrnS' ) );
   desc.putReference( cTID( "null" ), ref );
   executeAction( cTID( "slct" ), desc, DialogModes.NO );
   activeDocument.resizeImage( undefined, undefined, docRes, ResampleMethod.NONE );
}
setZoom(150);

jugenjuryAuthor
Inspiring
July 11, 2009

Thank you, Michael. My name is Mike, BTW.

That script you wrote will be very useful to me in my workflow. A lot better than what I already have. And it's a lot better suited for various monitors that may have a different dot pitch.

I really appreciate this. Thanks a lot!

Mike

Inspiring
July 11, 2009

You can set the zoom to 50, 100, 200, or 300 with either a script or an action. As far as I know you can not set the zoom to 75 or 150 with either.

With CS4 you can determine the currrent zoom of a document by getting the 'zoom' key of the document descriptor using action manager, but I have not been able to set the zoom using that key.