Sequential psd save script modification
Hi
here is one script which saves psd file Sequentially . Can anyone help me modify the script so that it could save the psd file by new name which is coppied in photoshop clipboard . I dont know where and how I should paste clipboard text. I coppied one layer name to clipboard and now I wish if this script could save the psd file by new name from clipboard text. If there is already .psd file of same name in output folder than it should save them sequentially.
Can anyone help me with this..and please dont get get angry over my english
Script is below
#target photoshop
main();
function main(){
if(!documents.length) return;
var Name = app.activeDocument.name.replace(/\.[^\.]+$/, '');
Name = Name.replace(/\d+$/,'');
try{
var savePath = activeDocument.path;
}catch(e){
alert("You must save this document first!");
}
var fileList= savePath.getFiles(Name +"*.psd").sort().reverse();
var Suffix = 0;
if(fileList.length){
Suffix = Number(fileList[0].name.replace(/\.[^\.]+$/, '').match(/\d+$/));
}
Suffix= zeroPad(Suffix + 1, 4);
var saveFile = File(savePath + "/" + Name + "_" + Suffix + ".psd");
SavePSD(saveFile);
}
function SavePSD(saveFile){
psdSaveOptions = new PhotoshopSaveOptions();
psdSaveOptions.embedColorProfile = true;
psdSaveOptions.alphaChannels = true;
psdSaveOptions.layers = true;
activeDocument.saveAs(saveFile, psdSaveOptions, true, Extension.LOWERCASE);
};
function zeroPad(n, s) {
n = n.toString();
while (n.length < s) n = '0' + n;
return n;
};
