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

'Fit to Screen' script shuffling file sequence

Community Beginner ,
Feb 09, 2023 Feb 09, 2023

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?

TOPICS
Actions and scripting , macOS

Views

2.1K
Translate

Report

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

correct answers 1 Correct answer

Community Expert , Feb 11, 2023 Feb 11, 2023

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
...

Votes

Translate
Adobe
Community Expert ,
Feb 13, 2023 Feb 13, 2023

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.

Votes

Translate

Report

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
LEGEND ,
Feb 13, 2023 Feb 13, 2023

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Report

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
Community Expert ,
Feb 11, 2023 Feb 11, 2023

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

 

Votes

Translate

Report

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