Copy link to clipboard
Copied
Only replies from Mac users/experts please:
I use a Macbook Pro 14" running the latest OS 13.1 and have an issue with a Photoshop script I created to automatically make large batches of images 'Fit to Screen' (command + 0) when opening. The script does what it's supposed to and upon opening large batches of photos from the RAW window into Photoshop, it flies through them all and resizes them to fit the window, but it shuffles them out of sequence which really messes with my workflow. I need them to open sequentially by filename as they normally would. Any ideas how I can fix the issue?
1 Correct answer
The following script will cycle over all open docs and fit to screen. Although It can be set to run via the Script Events Manager using the Open event, this would repeat the script for each document opened (the script is fast, but it seems pointless using this via the Open event). I have tested using a small batch of Raw files from ACR with prefs set to open as floating windows and the initial sort order is maintained.
/*
https://community.adobe.com/t5/photoshop-ecosystem-discussions/fit-to-sc
...
Explore related tutorials & articles
Copy link to clipboard
Copied
OK, I'm curious if the script retains the document open order? It did for me... That being said, it sounds like the floating document windows overlapping the panels is a recent programming change that is outside of scripting.
Copy link to clipboard
Copied
Nope, I have seen this in past versions. I (rarely) have to open several dozen images at once and this happens on both platforms. Not sure why things changed for the OP.
Copy link to clipboard
Copied
The following script will cycle over all open docs and fit to screen. Although It can be set to run via the Script Events Manager using the Open event, this would repeat the script for each document opened (the script is fast, but it seems pointless using this via the Open event). I have tested using a small batch of Raw files from ACR with prefs set to open as floating windows and the initial sort order is maintained.
/*
https://community.adobe.com/t5/photoshop-ecosystem-discussions/fit-to-screen-script-shuffling-file-sequence/m-p/13570962
v1.0, 11th February 2023, Stephen Marsh
*/
#target photoshop
if (app.documents.length) {
for (var i = 0; i < app.documents.length; i++) {
app.activeDocument = app.documents[i];
fitOnScreen();
}
} else {
alert('You must have a document open!');
}
function fitOnScreen() {
var idselect = stringIDToTypeID("select");
var desc1394 = new ActionDescriptor();
var idnull = stringIDToTypeID("null");
var ref710 = new ActionReference();
var idmenuItemClass = stringIDToTypeID("menuItemClass");
var idmenuItemType = stringIDToTypeID("menuItemType");
var idfitOnScreen = stringIDToTypeID("fitOnScreen");
ref710.putEnumerated(idmenuItemClass, idmenuItemType, idfitOnScreen);
desc1394.putReference(idnull, ref710);
executeAction(idselect, desc1394, DialogModes.NO);
}
https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html


-
- 1
- 2