#2021
|
|||
|
|||
![]()
Ok, thank you, I think that could answer some of my questions, I will try some more. o) So the newer methods return null/object and create parents, is there any drawback using the new methods or any reason to still use the old ones?
EDIT: Found the source for some of the file/folder methods here, seems helpful to explore the differences: github.com/mirror/jdownloader/blob/master/src/org/jdownloader/extensions/eventscripter/sandboxobjects/FilePathSandbox.java Last edited by tb21; 05.11.2021 at 21:04. |
#2022
|
|||
|
|||
![]()
I am guessing you are trying to move the entire folder using a single 'moveTo' call, which is not possible using this method.
You will have to use folder.getChildren() to recursively access/move each object in the folder. Using this method I have been able move entire folders with folder structure intact, even across different drives. It will however leave empty folders behind in the source location, which can also be removed using the same script. Another option (perhaps easier one) is to use external programs (OS or 3rd party) in eventscripter to move it. |
#2023
|
|||
|
|||
![]()
Yes, thank you for confirming, after analyzing the linked source file it is clear..
There is no recursive copy/move support in any of these methods. I did the getChildren() thing and did some new methods to make this work, I think they turned out nicely, will provide them here when final testing is done. Using an external tool is an option, yes, but that would tie the script to specific OS variants unless you branch depending on OS (I saw you have methods to do that). There's another downside with external tools though, in case things go wrong, it's much harder to get down to the problem (needs analyzing of std-err output or something?!). I am quite fine with the built in methods, the only thing I miss is being able to re-set the "modified" and "created" timestamps for copied/moved files. Losing timestamps is a severe disadvantage here. There is FilePath.getModifiedDate() already.. Who must I pay to add setModifiedDate(), getCreatedDate(), setCreatedDate()? To get fully working OS independent, recursive copy and move without losing timestamps? o) |
#2024
|
|||
|
|||
![]()
Does anyone know how to pass along parameters with callSync? I'm trying to send notifications with "notify-send" in ubuntu like:
Code:
callSync("notify-send","some text"); and that works fine, but if I want to add an icon, like with "-i battery" to the notify-send command, it does nothing. I tried many combinations with no luck. Thanks for any advice. |
#2025
|
|||
|
|||
![]() Code:
callSync("notify-send", "some text", "-i", "battery"); |
#2026
|
|||
|
|||
![]() Quote:
I use this script in the event scripter: Code:
var script = '/REDACTED/jdownloader-postprocess.sh' var package = archive.getDownloadLinks() ? archive.getDownloadLinks()[0].getPackage() : null var links = package ? package.getDownloadLinks() : [] function isReallyFinished() { for (var i = 0; i < links.length; i++) { if (links[i].getArchive() != null && links[i].getExtractionStatus() != "SUCCESSFUL" || !package.isFinished()) { return false } } return true } if (package && isReallyFinished()) { var command = [script, Extraction.customextractionpath(), package.getName(), package.getComment() ? package.getComment() : 'N/A', 'ARCHIVE_EXTRACTED'] log(command) log(callSync(command)) } |
#2027
|
|||
|
|||
![]()
Since I cannot access your screenshot, I cannot also know the exact error you are getting. But, the following method used in the script is invalid:
Code:
Extraction.customextractionpath() Try replacing it with: Code:
archive.getExtractToFolder(); |
#2028
|
|||
|
|||
![]() Quote:
Note for the mod: When will my account be unlocked for "more" freely usage? |
#2029
|
|||
|
|||
![]()
@mgpai thank you very much. It seems so obvious now to split the -i and battery which is something I didn't try. Ugh.
![]() |
#2030
|
||||
|
||||
![]()
@mrjjones
yes for some reason you cant have any spaces between switches and/or user defined section, must be all separated. @Gbyte unfortunately it has nothing todo with your account type, every user can post images/urls/etc but can not be viewed by anyone but moderators/admins. This is due to security/privacy concerns.
__________________
raztoki @ jDownloader reporter/developer http://svn.jdownloader.org/users/170 Don't fight the system, use it to your advantage. :] |
#2031
|
|||
|
|||
![]() Quote:
|
#2032
|
|||
|
|||
![]() Quote:
Code:
/* Interval > Add urls Trigger : Interval (Recommended 3600000 or more) */ var file = "Downloads/.torrent files/JDL Sync.txt"; // <- Set path to text file try { var links = readFile(getPath(file)); callAPI("linkgrabberv2", "addLinks", { links: links }) } catch (e) { alert(e.message); }; Pleas note, JD should be running for a longer period than the interval specified for it to be triggered. |
#2033
|
|||
|
|||
![]()
Hey!
Maybe you can help me, im new to this scripting stuff. I'm trying to write a script, to always have a specific amount of time between two reconnects. I have one script "after each reconnect" which should safe the current time. Another script "before each reconnect" which checks, if the time since the last reconnect is < x, and if not it waits until its < x (e.g. 90s). Now my problem: I cant access the variable from the first script in the second one. How can I make this global? I read that its global in Javascript, if its not inside a function. It isnt, its just now = new Date() Sorry, I'm really a total new to this... |
#2034
|
|||
|
|||
![]() Quote:
Code:
/* After a reconnect */ setProperty("lastReconnectTime", Date.now(), true); Code:
/* Before a reconnect */ var lastReconnectTime = getProperty("lastReconnectTime", true); |
#2035
|
|||
|
|||
![]()
hi, Thanks for the great software!
(1)Pass through the link grabber. There is always a URL to download. I tried, but dont work.. -- var host = "myhost.com"; var myString = myDownloadLink.getDownloadHost(); startDownloads(); -- (2)Unzip after downloading only the specified URL Now everything is unzip after download. I found a script that does batch processing after unzipping. tnx:) callAsync(function(){},"cmd","/c","c:/myFolder/myBatch.bat"); |
#2036
|
|||
|
|||
![]()
Are both scripts not working? Can you explain in detail what do you want the script to do or post your script here?
|
#2037
|
|||
|
|||
![]()
sorry,, I am looking for two scripts.
|
#2038
|
|||
|
|||
![]()
I will need more info. Contact me in IRC:
Code:
kiwiirc.com/nextclient/irc.libera.chat/#jdownloader |
#2039
|
|||
|
|||
![]()
Thank you for your help Mr Script Master!
|
#2040
|
|||
|
|||
![]() Quote:
|
![]() |
Thread Tools | |
Display Modes | |
|
|