Skip to main content
Known Participant
March 8, 2021
Answered

Auto-Save File After Creating Contact Sheet

  • March 8, 2021
  • 3 replies
  • 23017 views

Does anyone know how we can use the Automate>Contact Sheet II process, but to have Photoshop automatically save and even just close the files once it's done? For many folders from many scanned rolls, it's daunting to File>Save (or even Command+S, obviously) and to follow all the prompts for everything for each contact sheet when we just want them saved and closed out of at the end...

This topic has been closed for replies.
Correct answer Stephen Marsh

You can find the updated code to auto-save here:

 

https://raw.githubusercontent.com/MarshySwamp/Auto-Save-to-JPG-From-Contact-Sheet-II/main/Auto-Save-to-JPG-From-Contact-Sheet-II.jsx

 

Auto-Save-to-JPG-From-Contact-Sheet-II

 

Step 1 will be to select the save folder for the JPG files.

Step 2 will be the standard Contact Sheet II interface

Step 3 will be a message that all of the contact sheets have been saved to a specified path the save path will be opened in the Finder/Explorer.

 

Perhaps X or somebody else with more knowledge than me can comment on where/how to pickup the input folder and use that as the save location and or base-name prefix before the numbering suffix.

3 replies

Stephen Marsh
Community Expert
Stephen MarshCommunity ExpertCorrect answer
Community Expert
March 12, 2021

You can find the updated code to auto-save here:

 

https://raw.githubusercontent.com/MarshySwamp/Auto-Save-to-JPG-From-Contact-Sheet-II/main/Auto-Save-to-JPG-From-Contact-Sheet-II.jsx

 

Auto-Save-to-JPG-From-Contact-Sheet-II

 

Step 1 will be to select the save folder for the JPG files.

Step 2 will be the standard Contact Sheet II interface

Step 3 will be a message that all of the contact sheets have been saved to a specified path the save path will be opened in the Finder/Explorer.

 

Perhaps X or somebody else with more knowledge than me can comment on where/how to pickup the input folder and use that as the save location and or base-name prefix before the numbering suffix.

aottkeAuthor
Known Participant
March 16, 2021

Thank you so much. This worked like a charm! But yes, would be more useful to put into each subfolder. If you or anyone else figures that out in the future, please let me know 🙂 I would like to still get you a meal or something (through Venmo) or whatever I can do (and will help whoever solves the subfolder saving issue as well). Can I find you on there somehow?

Stephen Marsh
Community Expert
Community Expert
March 9, 2021

Run the Contact Sheet II script.

 

Then run the following script. It will save all open docs to PSD into a user selected folder, using the original document name.

 

 

/* 

Save All Open Docs to PSD.jsx
Stephen Marsh 2021

Auto-Save File After Creating Contact Sheet
https://community.adobe.com/t5/photoshop/auto-save-file-after-creating-contact-sheet/td-p/11879020

*/

/* Start Open Document Error Check - Part A: If */
if (app.documents.length > 0) {

    /* Main Code Start */

    (function () {

        // Select the output folder
        var outputFolder = Folder.selectDialog('Please select the save folder:');
        if (outputFolder === null) return;

        // Count open files
        var openFileCount = app.documents.length;

        // Loop through all open docs until no docs are open
        while (app.documents.length > 0) {
            saveOpenDocs();
        }

        // End of script notification
        alert(openFileCount + ' files saved to:' + '\r' + outputFolder.fsName);

        function saveOpenDocs() {
            var docName = app.activeDocument.name;
            var saveFilePSD = new File(new File(outputFolder + '/' + docName + '.psd'));
            SavePSD(saveFilePSD);
            app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);

            // Setup PSD options
            function SavePSD(saveFilePSD) {
                psdSaveOptions = new PhotoshopSaveOptions();
                psdSaveOptions.embedColorProfile = true;
                psdSaveOptions.alphaChannels = true;
                psdSaveOptions.layers = true;
                psdSaveOptions.annotations = true;
                psdSaveOptions.spotColors = true;
                app.activeDocument.saveAs(saveFilePSD, psdSaveOptions, true, Extension.LOWERCASE);
            }
        }

    })();

    /* Main Code Finish */
}
/* Finish Open Document Error Check - Part A: If */

/* Start Open Document Error Check - Part B: Else */
else {

    alert('A document must be open to use this script!');

}
/* Finish Open Document Error Check - Part B: Else */

 

 

https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html

 

aottkeAuthor
Known Participant
March 9, 2021

Thank you so much. Is it possible to save just as a JPG instead? Is it as easy as chanigng all the saveFilePSD to saveFileJPG in the script you shared? And this is a HUGE help by the way...thank you! Seems odd Adobe wouldn't include this ability naturally while they were at it when they created the Contact Sheet II script anyway.

Stephen Marsh
Community Expert
Community Expert
March 9, 2021

Yes, it is possible to save as JPG. I chose PSD as there was no other info so that was the safe choice. You can always use Image Processor script to batch convert PSD to JPG in the short term.


No, it is not as simple as a find/replace to change the script from PSD to JPG as the options are different. There are many example scripts on the site that save to JPG if you wanted to give it a try yourself (which may not be easy eiher).

 

Do you want save as or export save for web to JPG? What options? Can you show a screenshot of the options/settings or describe the various options required (quality level and other settings)?

 

What about the filename, do you want to type in a filename prefix to replace the default ContactSheet prefix before the numering suffix -001, -002 etc?

 

Stephen Marsh
Community Expert
Community Expert
March 8, 2021

A brand new unsaved file has to be provided options when saving (file format and options, location and possibly a new name).

 

This could be automated with a script that saves and closes all open files with a predetermined file type and options.

 

One could automate this into an action or script so that one could select and setup the contact sheet, then auto save/close.

 

 

aottkeAuthor
Known Participant
March 9, 2021

Thank you. I have used the batch process in the past to apply a certain action to a folder of images, and then the act of using the batch process allows for setup of file saving, naming, etc., before starting the batch process, so everything does get saved. Additionally, the saving and closing action can be done as part of the action saved to be run as the batch process it seems. But I can't figure out how to create an action that would automatically save and properly then close all the files irrespective of the exact number of files and folders and subfolders in the parent folder each and every time. In my admittedly limited experience, actions are fairly "dumb" and don't know how many times to do something necessarily based on the number of files in a dynamic way. Do you know how that can be done? I guess with some kind of script? But I'm not familiar with that. Any chance you might know how to do that?