Skip to main content
Participant
February 13, 2020
Question

Unique preset zoom percentage in one click

  • February 13, 2020
  • 3 replies
  • 711 views

I'd like to be able to zoom to a specific percentage with one click rather than having to type the (5 key stroke) percentage into the zoom percentage window.  Is there a way to do this?  Thanks

This topic has been closed for replies.

3 replies

Legend
February 14, 2020
Stephen Marsh
Community Expert
Community Expert
February 14, 2020
 
You will need to round to one decimal place, so 36.4%
 
Special thanks to Tom_Winkelmann
 
//community.adobe.com/t5/Photoshop/Image-View/m-p/10650951#M267319
//Image View
// Zoom image to N%

setZoom( 36.4); // Set the zoom %
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 );
}
Stephen Marsh
Community Expert
Community Expert
February 13, 2020

What  are the desired % value/s?

ChilicatAuthor
Participant
February 14, 2020

In this case, 36.36%. But I am curious in general if the presets can be changed, or if a one-button method for non-canned view percentages is available even if via actions, droplets, etc.

Bojan Živković11378569
Community Expert
Community Expert
February 14, 2020

"In this case, 36.36%"

Sounds to me that you may want to fit on screen?

You can use keyboard shortcut for that task or to record action which can be played using keyboard shortcut.