Move files
Hi friends! I need help getting a working script to create and move the open document to a sub folder called "Processed Image" I have this script but the current document has not been moved to the sub folder. Where is the error? Thank you
#target photoshop
app.bringToFront();
var docRef = app.activeDocument;
var sourceFolder = app.activeDocument.path ;
var File1 = docRef;
var tempFile = File1;
tempFile = tempFile.File1;
var outputFolder = new Folder(File1.path + "/Processed Image"); // defines the name of the subfolder
//Check if it exist, if not create it.
if(!outputFolder.exists) outputFolder.create(); //if subfolder not exist then create
if(tempFile != null){
var saveName = tempFile.name;
var res = tempFile.copy(new File(outputFolder+'/'+saveName));
if(res != true) throw('Unable to move file to '+decodeURI(backupFolder));
res = tempFile.copy(new File(outputFolder+'/'+saveName));
if(res != true){
throw('Unabe to move file to '+decodeURI(outputFolder));
}else{
// if we get here then the file has been backuped and moved to new folder so delete
tempFile.remove();
app.open(new File(outputFolder+'/'+saveName));// open moved file to work on
}
}
