Copy link to clipboard
Copied
Hi
When I reinstalled Photoshop on my new Windows computer (v24.0), the Zoom to Fit Shortcut (Ctrl-0) now fills the full space.
Previously it left a little gap at the top and bottom so I could easily use the marquee tool to select my artwork at the edges to copy it.
Now as its filled to the top and bottom, when I use the marquee tool it moves the board to be able to select up the edges so I have zoom out a bit again to be able to copy upto th edges.
Is there a way for it to fill but still leave a small gap still, or is this the way it just works now?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
And until it is fixed, you can help yourself with a small script. Copy the script into the scripts folder and then assign a shortcut (e.g. CTRL+0).
function sTID(s) {return app.stringIDToTypeID(s);}
app.runMenuItem(charIDToTypeID("FtOn"));
setZoom(zoomLevel()*.98);
function zoomLevel(){
if(!documents.length) return;
var ref = new ActionReference();
ref.putEnumerated( charIDToTypeID("Dcmn"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
var desc = executeActionGet(ref);
return desc.getDouble(stringIDToTypeID('zoom'))*100;
};
function setZoom( zoom ) {
cTID = function(s) { return app.charIDToTypeID(s); };
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 );
};
Copy link to clipboard
Copied
Thanks for that, but the script doesn't work.
I named it "Fit in window.jsx". I don't know anything about scripting, not sure if that's the right extension.
Copy link to clipboard
Copied
It's working now, I had failed to copy the brace and semicolon at the end.
But I can't figure out how to create a shortcut for it, since it doesn't appear in the list of scripts under File > Scripts – I have to click browse.
Copy link to clipboard
Copied
If you have copied it to the Scripts-folder of Photoshop (e.g. ..\Program Files\Adobe\Adobe Photoshop 2022\Presets\Scripts), you have to restart Photoshop - otherwise the entry does not appear.
Then assign the shortcut (Alt + Ctrl + Shift + K)
Copy link to clipboard
Copied
Thank you, a restart fixed it.