photoshop js code for imagemerege
I have this js code i want to change the code that this code create a new merged file with the name of folder that content images i actually want to create a new folder named "merged_photos" and in that folder a new merged image named as folder name and after folder name just add "_merged"
please help me
#target photoshop |
var runphotomergeFromScript = true; // must be before Photomerge include |
//@includepath "/Applications/Adobe Photoshop CS5/Presets/Scripts/" |
//@include "Photomerge.jsx" |
//@show include |
var inputFolder = Folder.selectDialog("Choose the folder containing the folders with the images to merge:"); |
var foldersToMerge = inputFolder.getFiles( function( file ) { return file instanceof Folder; } ); |
// If you want to safe the photomerge output to a user defined location, uncoment the line below. |
//var outputFolder = Folder.selectDialog("Choose the folder where you want to save the merged images:"); |
for( var i = 0; i < foldersToMerge.length; i++ ) { |
var activeFolder= foldersToMerge; |
var fileList = activeFolder.getFiles( '*.tif' ); |
|
// override Photomerge.jsx settings. Default is "Auto". Uncomment to override the default. |
//photomerge.alignmentKey = "Auto"; |
//photomerge.alignmentKey = "Prsp"; |
//photomerge.alignmentKey = "cylindrical"; |
//photomerge.alignmentKey = "spherical"; |
//photomerge.alignmentKey = "sceneCollage"; |
photomerge.alignmentKey = "translation"; // "Reposition" in layout dialog |
|
// other setting that may need to be changed. Defaults below |
photomerge.advancedBlending = true; // 'Bend Images Together' checkbox in dialog |
photomerge.lensCorrection = false; // Geometric Distortion Correction'checkbox in dialog |
photomerge.removeVignette = false; // 'Vignette Removal' checkbox in dialog |
|
if( fileList.length > 1 ){ |
photomerge.createPanorama(fileList,false); |
|
var tiffSaveOptions = new TiffSaveOptions(); |
//tiffSaveOptions.embedColorProfile = true; |
tiffSaveOptions.imageCompression = TIFFEncoding.TIFFLZW; |
//tiffSaveOptions.imageCompression = TIFFEncoding.NONE; |
|
if (typeof outputFolder == "undefined") { |
activeDocument.saveAs( new File( activeFolder + '.tif' ), tiffSaveOptions, ); |
} |
else { |
activeDocument.saveAs( new File( outputFolder + '/' + activeFolder.name + _merged + '.tif' ), tiffSaveOptions, ); |
} |
activeDocument.close( SaveOptions.DONOTSAVECHANGES ); |
