5 Replies Latest reply on Sep 17, 2016 1:30 PM by shavcat

    zooming to 50% shortcut

    ojodegato Level 1

      What are the available choices to assign a specific value to the zooming tool in the PS interface?

      Instead of cmd + 1 = 100%  cmd + 1 = 50%

        • 1. Re: zooming to 50% shortcut
          c.pfaffenbichler Level 8

          If nothing better turns up I suppose one should be able to assign a Keyboard Shortcut to a Script that does that.

          • 2. Re: zooming to 50% shortcut
            Noel Carboni Level 8

            Yes - 50% zoom is highly useful.  I find it an excellent way to check to see how a print is going to look and feel.

             

            Some time ago I requested a specific "Zoom to 50%" feature of Adobe (to go next to "Zoom to 100%" and "Zoom to 200%" features).  They acknowledged the request, but haven't yet scheduled the change as far as I can see.

             

            -Noel

            • 3. Re: zooming to 50% shortcut
              boo radley 2013 Level 3

              For a 72dpi document, run this script to zoom to 50%. Scroll further down for the 300dpi version. I found these codes over the internet and sort of pasted them together. The script can be adjusted to fit any resolution (100dpi, 200dpi, 600dpi, etc). It's very much a hack job, and the scripts run slow because Photoshop has to process the zoom levels, but they actually work.

               

               

               

               

              For 72dpi:

               

              function imageView (view)
                  {
                  var id73 = charIDToTypeID( "slct" );
                      var desc17 = new ActionDescriptor();
                      var id74 = charIDToTypeID( "null" );
                          var ref13 = new ActionReference();
                          var id75 = charIDToTypeID( "Mn  " );
                          var id76 = charIDToTypeID( "MnIt" );
                          if (view.length < 5) var id77 = charIDToTypeID( view );
                          else var id77 = stringIDToTypeID( view );
                          ref13.putEnumerated( id75, id76, id77 );
                      desc17.putReference( id74, ref13 );
                  executeAction( id73, desc17, DialogModes.NO );
                  }
              
              
                  imageView('ActP'); // 100%
                  imageView('FtOn'); // equivalent to Ctrl0
                  imageView('ZmIn'); // zoom in
                  imageView('ZmOt'); // zoom out
                  imageView('screenModeFullScreen');
                  imageView('screenModeStandard');
              
              
              // =======================================================
              
              
              main();
              function main(){
              
              
              if(!documents.length) return;
              var zoomLevels=[12.5, 25, 50, 100, 200, 300, 400];
              zoomOut();
              //zoomIn();
              function zoomOut(){
              var zoomLevel = getZoomLevel();
              for(var z in zoomLevels){
                  if(Number(zoomLevels[z]) > Number(zoomLevel)){
                      setZoomLevel(zoomLevels[z]);
                      break;
                      }
                  }
              };
              function zoomOut(){
              var zoomLevel = getZoomLevel();
              zoomLevels.reverse();
              for(var z in zoomLevels){
                  if(Number(zoomLevels[z]) < zoomLevel){
                      setZoomLevel(zoomLevels[z]);
                      break;
                      }
                  }
              };
              function getZoomLevel(){
              var ref = new ActionReference();
              ref.putEnumerated( charIDToTypeID("Dcmn"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
              var desc = executeActionGet(ref);
              return Number(desc.getDouble(stringIDToTypeID('zoom'))*100).toFixed(1);
              };
              function setZoomLevel( zoom ) {
                  if(zoom < 1 ) zoom =1;
                 var ref = new ActionReference();
                 ref.putEnumerated( charIDToTypeID("capp"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
                 var getScrRes = executeActionGet(ref).getObjectValue(stringIDToTypeID('unitsPrefs')).getUnitDoubleValue(stringIDToTypeID('newDocPresetScreenResolution'))/72;
                 var docRes = activeDocument.resolution;
                 activeDocument.resizeImage( undefined, undefined, getScrRes/(zoom/100), ResampleMethod.NONE );
                 var desc = new ActionDescriptor();
                 ref = null;
                 ref = new ActionReference();
                 ref.putEnumerated( charIDToTypeID( "Mn  " ), charIDToTypeID( "MnIt" ), charIDToTypeID( 'PrnS' ) );
                 desc.putReference( charIDToTypeID( "null" ), ref );
                 executeAction( charIDToTypeID( "slct" ), desc, DialogModes.NO );
                 activeDocument.resizeImage( undefined, undefined, docRes, ResampleMethod.NONE );
              };
              };
              
              
              
              
              
              
              

               

               

               

               

               

              For 300dpi:

               

              function imageView (view)
                  {
                  var id73 = charIDToTypeID( "slct" );
                      var desc17 = new ActionDescriptor();
                      var id74 = charIDToTypeID( "null" );
                          var ref13 = new ActionReference();
                          var id75 = charIDToTypeID( "Mn  " );
                          var id76 = charIDToTypeID( "MnIt" );
                          if (view.length < 5) var id77 = charIDToTypeID( view );
                          else var id77 = stringIDToTypeID( view );
                          ref13.putEnumerated( id75, id76, id77 );
                      desc17.putReference( id74, ref13 );
                  executeAction( id73, desc17, DialogModes.NO );
                  }
              
              
                  imageView('ActP'); // 100%
                  imageView('FtOn'); // equivalent to Ctrl0
                  imageView('ZmIn'); // zoom in
                  imageView('ZmOt'); // zoom out
                  imageView('screenModeFullScreen');
                  imageView('screenModeStandard');
              
              
              // =======================================================
              
              
              main();
              function main(){
              
              
              if(!documents.length) return;
              var zoomLevels=[12.5, 25, 50, 100, 200, 300, 400];
              zoomIn();
              //zoomOut();
              function zoomIn(){
              var zoomLevel = getZoomLevel();
              for(var z in zoomLevels){
                  if(Number(zoomLevels[z]) > Number(zoomLevel)){
                      setZoomLevel(zoomLevels[z]);
                      break;
                      }
                  }
              };
              function zoomOut(){
              var zoomLevel = getZoomLevel();
              zoomLevels.reverse();
              for(var z in zoomLevels){
                  if(Number(zoomLevels[z]) < zoomLevel){
                      setZoomLevel(zoomLevels[z]);
                      break;
                      }
                  }
              };
              function getZoomLevel(){
              var ref = new ActionReference();
              ref.putEnumerated( charIDToTypeID("Dcmn"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
              var desc = executeActionGet(ref);
              return Number(desc.getDouble(stringIDToTypeID('zoom'))*100).toFixed(1);
              };
              function setZoomLevel( zoom ) {
                  if(zoom < 1 ) zoom =1;
                 var ref = new ActionReference();
                 ref.putEnumerated( charIDToTypeID("capp"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
                 var getScrRes = executeActionGet(ref).getObjectValue(stringIDToTypeID('unitsPrefs')).getUnitDoubleValue(stringIDToTypeID('newDocPresetScreenResolution'))/72;
                 var docRes = activeDocument.resolution;
                 activeDocument.resizeImage( undefined, undefined, getScrRes/(zoom/100), ResampleMethod.NONE );
                 var desc = new ActionDescriptor();
                 ref = null;
                 ref = new ActionReference();
                 ref.putEnumerated( charIDToTypeID( "Mn  " ), charIDToTypeID( "MnIt" ), charIDToTypeID( 'PrnS' ) );
                 desc.putReference( charIDToTypeID( "null" ), ref );
                 executeAction( charIDToTypeID( "slct" ), desc, DialogModes.NO );
                 activeDocument.resizeImage( undefined, undefined, docRes, ResampleMethod.NONE );
              };
              };
              
              
              
              
              // =======================================================
              
              
              main();
              function main(){
              
              
              if(!documents.length) return;
              var zoomLevels=[12.5, 25, 50, 100, 200, 300, 400];
              zoomIn();
              //zoomOut();
              function zoomIn(){
              var zoomLevel = getZoomLevel();
              for(var z in zoomLevels){
                  if(Number(zoomLevels[z]) > Number(zoomLevel)){
                      setZoomLevel(zoomLevels[z]);
                      break;
                      }
                  }
              };
              function zoomOut(){
              var zoomLevel = getZoomLevel();
              zoomLevels.reverse();
              for(var z in zoomLevels){
                  if(Number(zoomLevels[z]) < zoomLevel){
                      setZoomLevel(zoomLevels[z]);
                      break;
                      }
                  }
              };
              function getZoomLevel(){
              var ref = new ActionReference();
              ref.putEnumerated( charIDToTypeID("Dcmn"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
              var desc = executeActionGet(ref);
              return Number(desc.getDouble(stringIDToTypeID('zoom'))*100).toFixed(1);
              };
              function setZoomLevel( zoom ) {
                  if(zoom < 1 ) zoom =1;
                 var ref = new ActionReference();
                 ref.putEnumerated( charIDToTypeID("capp"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
                 var getScrRes = executeActionGet(ref).getObjectValue(stringIDToTypeID('unitsPrefs')).getUnitDoubleValue(stringIDToTypeID('newDocPresetScreenResolution'))/72;
                 var docRes = activeDocument.resolution;
                 activeDocument.resizeImage( undefined, undefined, getScrRes/(zoom/100), ResampleMethod.NONE );
                 var desc = new ActionDescriptor();
                 ref = null;
                 ref = new ActionReference();
                 ref.putEnumerated( charIDToTypeID( "Mn  " ), charIDToTypeID( "MnIt" ), charIDToTypeID( 'PrnS' ) );
                 desc.putReference( charIDToTypeID( "null" ), ref );
                 executeAction( charIDToTypeID( "slct" ), desc, DialogModes.NO );
                 activeDocument.resizeImage( undefined, undefined, docRes, ResampleMethod.NONE );
              };
              };
              
              
              
              • 4. Re: zooming to 50% shortcut
                ojodegato Level 1

                thanks for the script, I will test it out.

                • 5. Re: zooming to 50% shortcut
                  shavcat

                  Today I was looking to solve this issue and find interesting solution.

                   

                  1) Change the screen resolution to 36 (instead of 72) under Preferences > Units and Rulers

                  2) Set a shortcut to View > Print Size