View Single Post
Old 18.05.2020, 04:40
zreenmkr zreenmkr is offline
JD Addict
Join Date: Feb 2020
Posts: 174

Originally Posted by MrBojangles_ View Post
1: This script works fine, until after it runs test.exe, when that task completes the downloads don't start again...I don't understand why.
use this to get the actual link status, you might also want to look into isSkipped();. instead of reset(); try resume();
//Trigger: Downloadlist ContextMenu Button Pressed
if (name == 'CheckLink Status') {
    try {
        link = lgSelection.getContextLink();
    } catch (e) {}
    try {
        link = dlSelection.getContextLink();
    } catch (e) {}

    var lnkStatus1 = link.getStatus();
    var lnkStatus2 = link.getFinalLinkStatus();
    alert('status1: ' + lnkStatus1 + '\nstatus2: ' + lnkStatus2);

2: I want to be able to measure the interval between occurrences of the script. For example take the system time, save as a global variable, then compare that with system time the next time a download goes offline.
not sure what you want to do with the time interval check. afaik jd eventscriptr is single instance script. every global variables are reset after script exited/completed. there is a workaround by save it out to txt file then read back at later time. scroll back to a few post sjust above for example. make sure text file name is unique by using the file name e.g link.getName(); again dont know what callSync("c:\\test.exe"); will give you but getStatus(); isSkipped(); & resume(); are all you might need

alternatively if you know why your files skip downloading or go offline frequently, you can also use trigger Interval and check every links every x minutes. Adapt this script to your own needs

Last edited by zreenmkr; 18.05.2020 at 06:11.
Reply With Quote