Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Sounds like something a script could do.
Copy link to clipboard
Copied
@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).
Copy link to clipboard
Copied
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);
}
https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
Yes 001 002 is perfect thankyou
it's very useful to have both (smart save and smart save incremental)
Copy link to clipboard
Copied
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);
}
Copy link to clipboard
Copied
that worked perfectly, stephen you are a genius. thanks so much!!
Copy link to clipboard
Copied
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.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more