JDownloader Community - Appwork GmbH
 

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #11  
Old 14.05.2019, 12:51
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,533
Default

Quote:
Originally Posted by sherbee View Post
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);
});
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 13:26.
Provided By AppWork GmbH | Privacy | Imprint
Parts of the Design are used from Kirsch designed by Andrew & Austin
Powered by vBulletin® Version 3.8.10 Beta 1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.