View Single Post
  #1378  
Old 18.05.2020, 15:57
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,157
Default

Quote:
Originally Posted by MrBojangles_ View Post
... maybe you can't stop and start downloads in the same script?
You can. You have to make sure the download controller has stopped, before you start it again. In your script, try adding the following after stopDownloads():

Code:
while (!isDownloadControllerIdle()) sleep(1000);

Should work, assuming some other link/script will not try to start the download in the meanwhile.

Quote:
Originally Posted by MrBojangles_ View Post
If I try to getProperty in a different script (or comment out first two lines in original script) though it tells me FirstTime is undefined. But I thought it should stay defined asa global variable until JD exits?
var myObject = setProperty(myString*"key"*//, myObject/*anyValue*/, myBoolean/*global(boolean)*/);

"key" should be "String"

Code:
if (getProperty("FirstTime", true) === null) {
    setProperty("FirstTime", {
        "stamp": Date.now()
    }, true);
}

var RetrievedTimeStamp = getProperty("FirstTime", true);
alert(RetrievedTimeStamp.stamp);
Reply With Quote