View Single Post
  #37  
Old 12.02.2017, 14:12
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 519
Default

Check for new update logs at user defined intervals and open them in notepad.
Code:
// View Update Log
// Trigger Required: "Interval"
// OS: Windows

var int = 10; // (minutes) <- Interval between checks.

if (interval == int * 60 * 1000) {
    var logFiles = getPath(JD_HOME + "/logs/updatehistory").getChildren();
    for (i = 0; i < logFiles.length; i++) {
        var logFile = logFiles[i];
        var age = new Date() - getPath(logFile).getModifiedDate();
        if (!/self/.test(logFile) && age < int * 60 * 1000) callAsync(function() {}, "notepad.exe", logFile);
    }
} else {
    interval = int * 60 * 1000;
}
Reply With Quote