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

a way to "smart" save automatically as JPG and PSD at the same time?

Enthusiast ,
Dec 29, 2025 Dec 29, 2025

i wonder is there any smart save feature, that would enable me at the click of a button

to save the file as a JPG and and a PSD at the same time, in the same folder with matching names?

 

this would save so much hassle, and make file organising much easier.

i find a lot of my time is wasted saving the psd, then clicking "save a copy"  and having to look for the folder, and try and remember the exact name.

 

thanks in advance

TOPICS
Actions and scripting , Windows
357
Translate
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
Adobe
Community Expert ,
Dec 29, 2025 Dec 29, 2025

Sounds like something a script could do.  

@Stephen Marsh ?

Translate
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 ,
Dec 29, 2025 Dec 29, 2025

@Trevor.Dennis - You are correct, there is something that's relatively easy to script in legacy ExtendScript (sadly UXP scripting is another story though, but I hope that Adobe will work on this and make it more accessible).

Translate
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 ,
Dec 29, 2025 Dec 29, 2025

@djmattyz 

 

Here is an example:


/*
Save PSD and JPEG to Source Folder.jsx
Stephen Marsh
v1.0 - 30th December 2025
https://community.adobe.com/t5/photoshop-ecosystem-discussions/a-way-to-quot-smart-quot-save-automatically-as-jpg-and-psd-at-the-same-time/td-p/15646991
*/

#target photoshop

var doc = app.activeDocument;
var docName = doc.name.replace(/\.[^\.]+$/, '');
var saveFolder;

try {
    saveFolder = doc.path;
} catch (err) {
    saveFolder = Folder.selectDialog("The document has not been saved yet.\nPlease select a folder to save the PSD and JPG files:");
    if (saveFolder == null) {
        alert("No folder selected. Script cancelled.");
        throw new Error("Cancelled");  // Exit script
    }
}

var savePSD = new File(saveFolder + '/' + docName + '.psd');
SavePSD(savePSD);

var saveJPEG = new File(saveFolder + '/' + docName + '.jpg');
SaveForWeb(saveJPEG);

app.beep();


function SavePSD(saveFile) {
    var psdSaveOptions = new PhotoshopSaveOptions();
    psdSaveOptions.embedColorProfile = true;
    psdSaveOptions.alphaChannels = true;
    psdSaveOptions.layers = true;
    psdSaveOptions.annotations = true;
    psdSaveOptions.spotColors = true;
    activeDocument.saveAs(saveFile, psdSaveOptions, true, Extension.LOWERCASE);
}

function SaveForWeb(saveFile) {
    var sfwOptions = new ExportOptionsSaveForWeb();
    sfwOptions.format = SaveDocumentType.JPEG;
    sfwOptions.includeProfile = true;
    sfwOptions.interlaced = 0;
    sfwOptions.optimized = true;
    sfwOptions.quality = 70;
    activeDocument.exportDocument(saveFile, ExportType.SAVEFORWEB, sfwOptions);
}

 

  1. Copy the code text to the clipboard
  2. Open a new blank file in a plain-text editor (not in a word processor)
  3. Paste the code in
  4. Save as a plain text format file – .txt
  5. Rename the saved file extension from .txt to .jsx
  6. Install or browse to the .jsx file to run (see below):

 

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

 

Translate
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
Enthusiast ,
Dec 29, 2025 Dec 29, 2025

hi stephen thats amazing thankyou so much,   it saves so much work!

im just thinking, since it doesnt ask for the file name (which is actually good) it would be a cool detail to have it add increments such as "File name 2"  if it encounters another one in the folder under the same name.   that way every incremental version of a photoshop psd, and its relative jpg are saved together.  i dont know if this is possible, but thought i would ask 

Translate
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 ,
Dec 29, 2025 Dec 29, 2025
quote

hi stephen thats amazing thankyou so much,   it saves so much work!

im just thinking, since it doesnt ask for the file name (which is actually good) it would be a cool detail to have it add increments such as "File name 2"  if it encounters another one in the folder under the same name.   that way every incremental version of a photoshop psd, and its relative jpg are saved together.  i dont know if this is possible, but thought i would ask 


By @djmattyz


Sure, that's certainly possible and a natural extension from the basic script.

 

l'll come back to you with an edit, do you want a digit based suffix (001, 002 etc) or a date/time stamp?

Translate
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
Enthusiast ,
Dec 29, 2025 Dec 29, 2025

Yes 001 002 is perfect thankyou

 it's very useful to have both (smart save and smart save incremental)

Translate
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 ,
Dec 29, 2025 Dec 29, 2025

@djmattyz 

 

Try this script:

 

/*
Save Incremental PSD and JPEG to Source Folder.jsx
Stephen Marsh
v1.0 - 30th December 2025
https://community.adobe.com/t5/photoshop-ecosystem-discussions/a-way-to-quot-smart-quot-save-automatically-as-jpg-and-psd-at-the-same-time/td-p/15646991
*/

#target photoshop

var doc = app.activeDocument;
var rawName = doc.name.replace(/\.[^\.]+$/, '');
var match = rawName.match(/^(.*?)(?:_(\d{3}))?$/);
var baseName = match[1];
var startIndex = match[2] ? parseInt(match[2], 10) : null;
var saveFolder;

try {
    saveFolder = doc.path;
} catch (err) {
    saveFolder = Folder.selectDialog(
        "The document has not been saved yet.\nPlease select a folder to save the PSD and JPG files:"
    );
    if (!saveFolder) {
        alert("No folder selected. Script cancelled.");
        throw new Error("Cancelled");
    }
}

var index = getNextIndex(saveFolder, baseName, startIndex);

while (true) {
    var suffix = (index === 0) ? "" : "_" + zeroPad(index, 3);
    var psdFile = new File(saveFolder + "/" + baseName + suffix + ".psd");
    var jpgFile = new File(saveFolder + "/" + baseName + suffix + ".jpg");
    if (!psdFile.exists && !jpgFile.exists) {
        break;
    }
    index++;
}

SavePSD(psdFile);
SaveForWeb(jpgFile);
app.beep();


function getNextIndex(folder, name, docIndex) {

    var files = folder.getFiles();
    var maxIndex = -1;

    for (var i = 0; i < files.length; i++) {
        if (!(files[i] instanceof File)) continue;

        var fname = files[i].name;

        if (fname === name + ".psd" || fname === name + ".jpg") {
            maxIndex = Math.max(maxIndex, 0);
            continue;
        }

        var re = new RegExp("^" + name + "_(\\d{3})\\.(psd|jpg)$", "i");
        var m = fname.match(re);

        if (m) {
            var num = parseInt(m[1], 10);
            if (!isNaN(num)) {
                maxIndex = Math.max(maxIndex, num);
            }
        }
    }

    if (docIndex !== null) {
        maxIndex = Math.max(maxIndex, docIndex);
    }

    if (maxIndex === -1) {
        return 0;
    }

    return maxIndex + 1;
}

function zeroPad(num, digits) {
    var s = num.toString();
    while (s.length < digits) s = "0" + s;
    return s;
}

function SavePSD(saveFile) {
    var opts = new PhotoshopSaveOptions();
    opts.embedColorProfile = true;
    opts.alphaChannels = true;
    opts.layers = true;
    opts.annotations = true;
    opts.spotColors = true;
    activeDocument.saveAs(saveFile, opts, true, Extension.LOWERCASE);
}

function SaveForWeb(saveFile) {
    var opts = new ExportOptionsSaveForWeb();
    opts.format = SaveDocumentType.JPEG;
    opts.includeProfile = true;
    opts.interlaced = false;
    opts.optimized = true;
    opts.quality = 70;
    activeDocument.exportDocument(saveFile, ExportType.SAVEFORWEB, opts);
}
Translate
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
Enthusiast ,
Dec 30, 2025 Dec 30, 2025

that worked perfectly, stephen you are a genius.  thanks so much!!

Translate
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 ,
Dec 30, 2025 Dec 30, 2025
LATEST

It sounds like this question might already be taken care of by the script, but I was just wondering…is there a reason the old standby Image Processor won’t work for this? (The command is File > Scripts > Image Processor.) It has always had the ability to save up to three copies into different formats, with control over the destination folder, and it’s easy to assign a keyboard shortcut to it. 

 

The main advantage I can see of Stephen’s script over Image Processor is that the script can increment the file name if there’s a filename conflict, I don’t think Image Processor can take care of that but I haven’t checked.

 

Photoshop-Image-Processor.jpg

Translate
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