I need help about move files

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Tom, Kukurykus

akshar3375

I need help about move files

Post by akshar3375 »

Hi masterminds

I need your help about this Script

#target photoshop
app.bringToFront();
var docRef = app.activeDocument;
var sourceFolder = app.activeDocument.path ;// change to folder from where you receive images
//////////////////////////////////////////////////////////////////////
var File1 = docRef;
var tempFile = File1;
tempFile = tempFile.File1;
var outputFolder = new Folder(File1.path + "/AkshaR Backup"); // 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();// can not be undone
app.open(new File(outputFolder+'/'+saveName));// open moved file to work on
}
}


thanks,