Quote:
Originally Posted by sherbee
Thank you for idea. But I like complicated.
|
Here is a new script, but if you need help to troubleshoot/fix yours, contact me in JD Chat.
Code:
// Move archive files after extraction
// Trigger: Archive Extraction Finished
var links = archive.getDownloadLinks() || [];
var destinationFolder = "C:/sherbee/check";
links.forEach(function(link) {
var filePath = getPath(link.getDownloadPath());
var i = 0;
while (getPath(destinationFolder + "/" + filePath.getName()).exists()) {
i++;
newPath = getPath(link.getDownloadPath().toString().replace(/(.+)(\..+)/, "$1" + i + "$2"));
getPath(filePath).renameTo(newPath);
filePath = newPath;
}
filePath.moveTo(destinationFolder);
});