Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Do I need a script to automate zoom levels?

Engaged ,
Jul 10, 2009 Jul 10, 2009

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.

TOPICS
Actions and scripting
1.9K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Guru ,
Jul 10, 2009 Jul 10, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Jul 11, 2009 Jul 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);

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jul 11, 2009 Jul 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Jul 12, 2009 Jul 12, 2009

Very cool solution, Mike. I've added it to stdlib.js.

-X

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jul 13, 2009 Jul 13, 2009
LATEST

xbytor2 wrote:

Very cool solution, Mike. I've added it to stdlib.js.

-X

xbytor2,

Keep in mind that when doing it this way, the print size of the document is changed. If someone were to use this, then print their document it may produce unexpected results.

Maybe Mike can add a reset into his script to reset the print size back to the original after using the "Print Size View" to change the zoom level.

Edit: Sorry, I didn't look close enough. I guess he thought of that.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines