JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #1  
Old 16.05.2022, 18:19
steveallen steveallen is offline
Vacuum Cleaner
 
Join Date: Apr 2020
Posts: 18
Default Move files after finished to another drive:\folder

Hi,
- Is there a way to move files/folders when they are completely finished ( archives extracted if any, and links is removed from jdl ..)

idealy would be nice if i could set à folder ( drive:\folder ) to set new destination whan file is done/complete...

-------
I was watching / searching jdl boards... I found / looked:
Script to move file after finished
https://board.jdownloader.org/showth...ile#post485531

I also look here but could not find what i am looking:
https://board.jdownloader.org/showthread.php?t=70525

-----

I just want a global simple method to move all files to another drive:\folder when dl files finished...

Many thanks in advance.


Note / adding: I just tried this, but don't work yet... if this is the way ? can you tell me what's wrong in my script ? tks.

// Move downloaded files to user-specified folder
// Trigger: A Download Stopped

if (link.finished) {
var destinationFolder = "/home/";
getPath(link.downloadPath).moveTo(R:\Files_Done);
}

Last edited by steveallen; 16.05.2022 at 18:34. Reason: adding ...
Reply With Quote
  #2  
Old 16.05.2022, 18:23
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 76,935
Default

@steveallen: you can either make use of Eventscripter and a script to move finished files, see https://board.jdownloader.org/showthread.php?t=70525
or a combination of Packagizer Rules and Eventscripter script. Packagizer rule to download archives into temp location and script to move extracted files to final location while
another Packagizer Rule that changed download location for non archive files directly to the final location.
__________________
JD-Dev & Server-Admin
Reply With Quote
  #3  
Old 16.05.2022, 18:35
steveallen steveallen is offline
Vacuum Cleaner
 
Join Date: Apr 2020
Posts: 18
Default

sorry did not seen your reply first...



I just tried this, but don't work yet... if this is the way ? can you tell me what's wrong in my script ? tks.

// Move downloaded files to user-specified folder
// Trigger: A Download Stopped

if (link.finished) {
var destinationFolder = "/home/";
getPath(link.downloadPath).moveTo(R:\Files_Done);
Reply With Quote
  #4  
Old 16.05.2022, 18:41
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 76,935
Default

@steveallen: as far as I know there is more sophisticated script because that simple script will make extraction fail as it moves the files *away* before JDownloader had a chance to complete extract it.
Please use search in that thread or ask in it for help/hint.
you should go with the "Packager rule + Eventscripter script* solution because you can directly download non archive files to final directory and not have to move them around in first place
__________________
JD-Dev & Server-Admin
Reply With Quote
  #5  
Old 16.05.2022, 19:45
steveallen steveallen is offline
Vacuum Cleaner
 
Join Date: Apr 2020
Posts: 18
Default

This script works for files under a sub folder :
- it move all files under a sub folder but actually i would like to move the complete sub folder ... can you tell me what to change to the script ? Thanks

// Move finished non-archive files, to user defined folder
// Trigger required: "A Download Stopped"

var destFolder = "c:/myFolder/Finished";

if (link.isFinished() && !link.getArchive()) {
getPath(link.getDownloadPath()).moveTo(destFolder);
}
Reply With Quote
  #6  
Old 17.05.2022, 09:44
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 76,935
Default

@steveallen: please ask questions about scripting/scripts in the thread for eventscripter. There ppl will read it and can provide help/hints. Doesn't make sense in spreading questions about scripts across different threads.
__________________
JD-Dev & Server-Admin

Last edited by pspzockerscene; 17.05.2022 at 11:38. Reason: Added hyperlink for EventScripter thread
Reply With Quote
Reply

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 04:41.
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 - 2022, Jelsoft Enterprises Ltd.