#target photoshop
main();
function main(){
var inputFolder = Folder.selectDialog("Please select the folder with Files to process");
if(inputFolder == null) return;
var startRulerUnits = preferences.rulerUnits;
app.displayDialogs = DialogModes.NO;
var outputFolder = Folder(inputFolder + "/Combined");
if(!outputFolder.exists) outputFolder.create();
var fileList = inputFolder.getFiles(/.jpg$/i);
while(fileList.length>0){
preferences.rulerUnits = Units.PIXELS;
if(fileList.length==1) break;
var mainDoc = open(fileList.shift());
mainDoc.resizeCanvas(mainDoc.width, [COLOR=#ff0000](mainDoc.height*2)[/COLOR], AnchorPosition.TOPLEFT);
var tmp = open(fileList.shift());
tmp.activeLayer.duplicate(mainDoc);
tmp.close(SaveOptions.DONOTSAVECHANGES);
var LB = mainDoc.activeLayer.bounds;
mainDoc.activeLayer.translate((mainDoc.width-LB[2].value),0);
mainDoc.flatten();
preferences.rulerUnits = Units.PERCENT;
mainDoc.resizeImage(66.66666, undefined, undefined, ResampleMethod.BICUBICSHARPER);
var saveFile = File(outputFolder + "/" + decodeURI(activeDocument.name));
SaveJPEG(saveFile, 10);
mainDoc.close(SaveOptions.DONOTSAVECHANGES);
}
preferences.rulerUnits = startRulerUnits;
}
function SaveJPEG(saveFile, jpegQuality){
jpgSaveOptions = new JPEGSaveOptions();
jpgSaveOptions.embedColorProfile = true;
jpgSaveOptions.formatOptions = FormatOptions.STANDARDBASELINE;
jpgSaveOptions.matte = MatteType.NONE;
jpgSaveOptions.quality = jpegQuality;
activeDocument.saveAs(saveFile, jpgSaveOptions, true,Extension.LOWERCASE);