#2001
|
|||
|
|||
![]() Quote:
![]() |
#2002
|
|||
|
|||
![]()
Title bar would be fantastic as well. Can you do this please?
|
#2003
|
|||
|
|||
![]() Quote:
Code:
/* Append next execution time to title bar */ var current = "|#TITLE|| - #SPEED/s|| - #UPDATENOTIFY|"; // Replace this with your current title pattern var date = new Date(Date.now() + interval).toString().substr(4, 20); var pattern = current + "|" + date; callAPI( "config", "set", "org.jdownloader.settings.GraphicalUserInterfaceSettings", null, "TitlePattern", pattern ) |
#2004
|
|||
|
|||
![]() Quote:
|
#2005
|
|||
|
|||
![]()
Remove the relevant code from the script and manually restore the old name.
|
#2006
|
|||
|
|||
![]() Quote:
![]() Have a good day! |
#2007
|
|||
|
|||
![]()
Hi there and thanks for all the ideas around the EventScripter. I found this script somewhere above to move downloads after extraction,
Quote:
Many thanks for your support and ideas! KlaraBlik |
#2008
|
|||
|
|||
![]() Quote:
Code:
/* Move extracted files Trigger: Archive extraction finished */ var source = "C:\\Downloads"; var destination = "C:\\Finished"; var fileTypes = ["mp3", "ex1", "ex2"]; archive.extractedFilePaths.forEach(function(filePath) { if (fileTypes.indexOf(filePath.extension) > -1) { var newFolder = filePath.parent.toString().replace(source, destination); filePath.moveTo(newFolder); } }) |
#2009
|
|||
|
|||
![]()
@mgpai: Thank you so much for your fast answer, I will give it a try! Only one question left: Is there a event which covers both downloaded and extracted mp3-files or would you recommend two scripts (one to move downloaded files which were not zipped) and one to move extracted files?
|
#2010
|
|||
|
|||
![]()
Is there anyway, perhaps with scripting, to send any custom bubble notifications? I'd like to have a bubble notify with package/link name on link added to the link grabber. Although I didn't try, it looks like there is an advanced setting to show the filename when downloads are added, but I'm looking to have something like that when links are added to the link grabber instead like from the clipboard.
|
#2011
|
|||
|
|||
![]() Quote:
Packagizer rule: Code:
if > file name contains > *.mp3 then set > download directory > c:\downloads\JDownloader\downloaded\mp3 then do > move to > c:\downloads\JDownloader\extracted\mp3 The example rule uses different folders for normal and extracted files. Same/single folder can also be used for both. |
#2012
|
||||
|
||||
![]()
@mrjjones: You could use 3rd party tools/support for your OS/mobile...and then use script to send noticiation to this app/tool/service which then shows the notification for you.
__________________
JD-Dev & Server-Admin |
#2013
|
|||
|
|||
![]()
I hope you don't mind if I add another question into the mix, I'm not sure yet if this thread is ok for that, or whether I should open a new thread for each? Things seem to mix up here very quickly, but anyway.. let's have the question now. o)
I have problems moving folders with FilePath.moveTo(), renameTo(), renamePath(). In the meantime I started to write my own functions to copy/move folder structures around, but is that recommended? Should the mentioned methods work for folders as well, even across drives? tia! o) |
#2014
|
||||
|
||||
![]()
@tb21: move only works if src and dest are on same drive/mountpoint.
__________________
JD-Dev & Server-Admin |
#2015
|
|||
|
|||
![]() Quote:
If anyone else needs, for linux there is notify-send (install with: sudo apt install libnotify-bin) and use a JDownloader script like: Code:
var linkName = link.getName(); callSync("notify-send",linkName+""); |
#2016
|
|||
|
|||
![]()
Ok, not optimal and I would think it doesn't even work correctly for same mountpoints/drives when folders are involved, but anyway, enough reason for me to carry on with the custom functions, thank you! o)
btw: Is there a (better) reference somewhere for the mentioned methods? I started to test whether each method wants just path or fullpath (including name), but got exhausted quickly, since testing all the methods and how they work for files/folders, different parameters and same/different mountpoint is quite tedious. |
#2017
|
||||
|
||||
![]()
@mrjjones: You're welcome
![]() ![]() @tb21: I could not reproduce issues with moveTo when on same drive/mountpoint. renameTo(returns false/true) is the same as rename(returns null/new File object): full path to file/folder rename/moves the file/folder but does NOT auto create parent folder. fails if parent folder does not exist moveTo(returns true/false): full path to file/folder rename/moves the file/folder but does auto create parent folder if not exist yet renameName: change name only -> new name of file/folder only renamePath: change parent of file/folder -> full path of new parent folder, name of file/folder is the same
__________________
JD-Dev & Server-Admin Last edited by Jiaz; 05.11.2021 at 20:07. |
#2018
|
|||
|
|||
![]()
renamePath() seems to expect path for me, as it puts FilePathObj into the folder-path given.
It kind of makes sense for renamePath(), but you say it expects full path, which would include a new name for the target folder, which I did not experience. Code:
// moves files across drives (into existing path only), not folders var r = testFoldObj.renamePath( /* path */ "D:\\lala"); Code:
// always == false, it just copies the folder without content and does not delete src folder var r = testFoldObj.moveTo( /* fullPath */ ); // always == false, fails completely for folders, does nothing, new fullpath or just new name both fail var r = testFoldObj.renameTo( /* fullPath */ ); // always == null, fails completely for folders var r = testFoldObj.renamePath( /* fullPath */ ); renameTo(), rename(), renamePath() and renameName() - I get the last one at least I think.. o) |
#2019
|
|||
|
|||
![]()
Let me add..
I mostly tried folders which contain subfolders (iirc).. If there are no know bugs and you are sure all this works es expected.. I won't start a fight o). I think I can get along with copying single items, rebuilding folder structure with mkdirs() and delete things afterwards if I want to turn a copy-operation into a move. I would have like to prevent unnecessary copy and disk space requirements for "same mountpoint" moves of course, but it's not a show stopper for me. |
#2020
|
||||
|
||||
![]()
@tb21: I've updated my post https://board.jdownloader.org/showpo...postcount=2017
Reason for newer methods is that the old methods follows File Java class while newer return different object and work differently (eg auto create parent folder) Maybe the commands fail because of missing parent folder?
__________________
JD-Dev & Server-Admin Last edited by Jiaz; 05.11.2021 at 20:08. |
![]() |
Thread Tools | |
Display Modes | |
|
|