Skip to main content
Inspiring
December 30, 2025
Answered

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

  • December 30, 2025
  • 3 replies
  • 500 views

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

Correct answer Stephen Marsh

@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

 

3 replies

Conrad_C
Community Expert
Community Expert
December 31, 2025

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

Stephen Marsh
Community Expert
Stephen MarshCommunity ExpertCorrect answer
Community Expert
December 30, 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

 

djmattyzAuthor
Inspiring
December 30, 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 

Stephen Marsh
Community Expert
Community Expert
December 30, 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?

Trevor.Dennis
Community Expert
Community Expert
December 30, 2025

Sounds like something a script could do.  

@Stephen Marsh ?

Stephen Marsh
Community Expert
Community Expert
December 30, 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).