Quantcast
Channel: Adobe Community: Message List - Photoshop Scripting
Viewing all articles
Browse latest Browse all 27456

Re: Save As in Parent Directory

$
0
0

At first: Please do not use the name parent for a folder that you want to call with scripting. parent has a function in javascript.

 

 

// http://forums.adobe.com/thread/1251089?tstart=0// required on desktop: "File1.bmp" and 2 folders named "Delete" and "Working"// regards pixxxelschubser  
var aFileName = "File1.bmp"// var yourFilePath = "…/PleaseName_It_Not_Parent/";  //instead of the next line
var aFilePath = "~/Desktop/";
var DelFolder = aFilePath+"Delete/";
var WorkFolder = aFilePath+"Working/";
var aFile = File(aFilePath+aFileName); 
var aDoc = open (aFile);
var DelFile = new File(DelFolder+aDoc.name); 
var saveName = aDoc.name.replace (/\.bmp$/,'.tif');
var saveFile = new File(WorkFolder+saveName); // do something if(aFile.copy(DelFile)){    aFile.remove();    }else{alert("File can't be move to DeleteFolder")} 
SaveAsTIFF(saveFile);
activeDocument.close( SaveOptions.DONOTSAVECHANGES ); 
function SaveAsTIFF(saveFile){
tiffSaveOptions = new TiffSaveOptions();
tiffSaveOptions.layers = true;
activeDocument.saveAs(saveFile, tiffSaveOptions, false); }

 

Repeat the saving process (but now tif to bmp) and delete the tif file.

 

Have fun


Viewing all articles
Browse latest Browse all 27456

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>