@MartinDedron
Try the following code. Changes can be made if necessary.
/*
Save Open Raw Render to 3 Files.jsx
https://community.adobe.com/t5/photoshop-ecosystem-ideas/exporting-saving-as-should-be-made-easier-and-automated/idc-p/14040624
v1.0 - 27th August 2023, Stephen Marsh
*/
#target photoshop
var origPath = activeDocument.path.fsName;
var docName = activeDocument.name.replace(/\.[^\.]+$/, '');
var saveFileTIFF = new File(origPath + '/' + docName + '.tif');
var saveFileJPEG = new File(origPath + '/' + docName + '.jpg');
var saveFileSmallJPEG = new File(origPath + '/' + docName + '_2048px' + '.jpg');
saveTIFF(saveFileTIFF);
saveJPEG(12, saveFileJPEG);
fitImage(2048, 2048);
saveSmallJPEG(10, saveFileSmallJPEG);
activeDocument.close(SaveOptions.DONOTSAVECHANGES);
function saveTIFF(saveFileTIFF) {
tiffSaveOptions = new TiffSaveOptions();
tiffSaveOptions.embedColorProfile = true;
tiffSaveOptions.byteOrder = ByteOrder.IBM;
tiffSaveOptions.transparency = true;
tiffSaveOptions.layers = true;
tiffSaveOptions.layerCompression = LayerCompression.ZIP;
tiffSaveOptions.interleaveChannels = true;
tiffSaveOptions.alphaChannels = true;
tiffSaveOptions.annotations = true;
tiffSaveOptions.spotColors = true;
tiffSaveOptions.saveImagePyramid = false;
tiffSaveOptions.imageCompression = TIFFEncoding.NONE;
activeDocument.saveAs(saveFileTIFF, tiffSaveOptions, true, Extension.LOWERCASE);
}
function saveJPEG(compValue, saveFileJPEG) {
var jpegSaveOptions = new JPEGSaveOptions();
jpegSaveOptions.embedColorProfile = true;
jpegSaveOptions.formatOptions = FormatOptions.STANDARDBASELINE;
jpegSaveOptions.matte = MatteType.NONE;
jpegSaveOptions.quality = compValue;
activeDocument.saveAs(saveFileJPEG, jpegSaveOptions, true, Extension.LOWERCASE);
}
function saveSmallJPEG(compValue, saveFileSmallJPEG) {
var jpegSaveOptions = new JPEGSaveOptions();
jpegSaveOptions.embedColorProfile = true;
jpegSaveOptions.formatOptions = FormatOptions.STANDARDBASELINE;
jpegSaveOptions.matte = MatteType.NONE;
jpegSaveOptions.quality = compValue;
activeDocument.saveAs(saveFileSmallJPEG, jpegSaveOptions, true, Extension.LOWERCASE);
}
function fitImage(fWidth, fHeight) {
if (activeDocument.height > activeDocument.width) {
activeDocument.resizeImage(null, UnitValue(fHeight, "px"), null, ResampleMethod.BICUBIC);
} else {
activeDocument.resizeImage(UnitValue(fWidth, "px"), null, null, ResampleMethod.BICUBIC);
}
}
Info on saving and running scripts here:
https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html
... View more