prevent overwrite files when saving
Hello guys
I have this snippet part of a script that save as TIFF version in a folder, How can i prevent overwrite is the File already exist in the folder, I would like to add a sequence numbering each time save the file.
I want to keep the orginial name plus sequance numbering at the end.
I try to do this with increament increase but, but I think i am missing something like checking if the file exist if it does not add sequence numbering. i am stuck for now, hope someone can help.
Thanks in advance.
var count = [0];
incrementCount();
function incrementCount(){
count++;
}
// saving location
var outputFolder = new File('/Dropbox/TIFF-ProPhoto/');
var Name = app.activeDocument.name.slice(0, -4);
var saveFile = File(outputFolder + '/' + Name + '_ProPhoto' + count + '.tiff');
saveTIFF(saveFile);
