View Single Post
  #713  
Old 13.05.2019, 20:18
sherbee sherbee is offline
JD Fan
 
Join Date: Mar 2019
Posts: 76
Default

Quote:
Originally Posted by mgpai View Post
Code:
// Move archive files after extraction
// Trigger: Archive Extraction Finished

var links = archive.getDownloadLinks() || [];

links.forEach(function(link) {
    var filePath = getPath(link.getDownloadPath());
    filePath.moveTo(filePath.getParent().toString().replace("JD Downloads", "!TRASH!"));
});
Idea how to handle rename if file name already exists? Is there trigger or event to use? And what renaming plan would be best? Becaus if name exists script does not move.
Reply With Quote