#1261
|
|||
|
|||
![]()
Thank you Script Master mgpai!
This works wonderful for the context menu! But if I try to use it for the tool-bar it gives this error: "Security Violation: Security Violation org.jdownloader.extensions.eventscripter.sandboxobjects.DownloadlistSelectionSandbox (#8)" What am I doing wrong? |
#1262
|
||||
|
||||
![]()
Thank you very much for your help & efforts mgpai.
Best Regards Tunay |
#1263
|
|||
|
|||
![]()
You will not be able to use it with other triggers, since it uses the download list selection property which is available only with context menu trigger.
|
#1264
|
|||
|
|||
![]() Quote:
But thank you very much for your time and energy! JD is the best! ;-) |
#1265
|
||||
|
||||
![]()
Thanks for your nice feedback and thanks to mgpai's helping hands here!
Stay healthy! -psp-
__________________
JD Supporter, Plugin Dev. & Community Manager Erste Schritte & Tutorials || JDownloader 2 Setup Download ----------------------------------- On Vacation / Im Urlaub Start: 2023-12-09 End: TBA |
#1266
|
|||
|
|||
![]()
I hope you know it is also possible to assign keyboard short cuts even to the eventscripter trigger buttons. Can select the links and just press a keyboard button to delete them. You can even remap the default 'del' key to it.
|
#1267
|
|||
|
|||
![]() Quote:
Would it be possible to simulate a keypress in a script? I.e. the keypress which I then designate to the context-menu-button-"Move to trash"? Or if not, is it possible to execute an external bash-script from the tool-bar-button? ... and in this external script I could simulate the keypress with xdotool - command. I know, it sounds kind of complicated, but it should work, shouldn't it? |
#1268
|
|||
|
|||
![]()
Not directly. But can use external tools (like ahk or autoit in windows) in a script to do that.
Quote:
Example script for toolbar button trigger: Code:
// Run external script // Trigger: Toolbar Button Pressed if (name == "myButtonName") { var myScript = "/path/to/bash/script.sh"; callSync(myScript); } |
#1269
|
|||
|
|||
![]() Quote:
Ah ... wonderful! ... It is a bit slow ... but works like a charm! :-) Thank you very much! ... Makes me happy! You guys stay healthy too! |
#1270
|
||||
|
||||
![]()
__________________
JD Supporter, Plugin Dev. & Community Manager Erste Schritte & Tutorials || JDownloader 2 Setup Download ----------------------------------- On Vacation / Im Urlaub Start: 2023-12-09 End: TBA |
#1271
|
|||
|
|||
![]() ![]() ![]() ![]() |
#1272
|
||||
|
||||
![]()
__________________
JD Supporter, Plugin Dev. & Community Manager Erste Schritte & Tutorials || JDownloader 2 Setup Download ----------------------------------- On Vacation / Im Urlaub Start: 2023-12-09 End: TBA |
#1273
|
|||
|
|||
![]()
Hey guys!
I am very proud of myself! ... Without even knowing what programming language these scripts are in, I managed to combine your 2 scripts, mgpai, into one ... the first one "Move to trash" and the other one "Play finished and unfinished files". So now the script does move finished and unfinished files to trash and also deletes the links. In case another Linux-user is interested: Code:
/* Remove selected links and move files to trash Trigger: "Downloadlist Contextmenu Button Pressed" Customize download list context menu > Add a new "Eventscripter trigger" button > Rename it to "[Script] Remove links and move files to trash" (without quotes) > Change Icon (Optional) */ if (name == "[Script] Remove links and move files to trash") { var links = dlSelection.getLinks(); if (links.length) { links.forEach(function(link) { var file = getPath(link.getDownloadPath()); link.remove(); if (file.exists()) { callSync("kioclient", "move", file, "trash:/"); } else { var partFile = getPath(file + ".part"); if (partFile.exists()) { callSync("kioclient", "move", partFile, "trash:/"); } } }) } } Only unfinished youtube-files are not being moved to trash. I guess it is because of their strange naming. But in my case this is not a very big deal. Would be glad, if this is of help for someone! ... ![]() |
#1274
|
||||
|
||||
![]() Quote:
This is only possible when the one who made them initially commented them well enough so thx mgpai ![]() -psp-
__________________
JD Supporter, Plugin Dev. & Community Manager Erste Schritte & Tutorials || JDownloader 2 Setup Download ----------------------------------- On Vacation / Im Urlaub Start: 2023-12-09 End: TBA |
#1275
|
|||
|
|||
![]()
...
![]() |
#1276
|
|||
|
|||
![]()
Good evening everyone,
.... ..edit. ( sorry, solved found the problem) ..... doing my tests I got a <STDOUT stream> with my data but I should divide them (for now I'm on two lines), there is a way to say (for example) that row 1 corresponds to "X" while row two is " Y "? <data = callSync (myScript)> ----> the script return a stdout stream in the "data" i have : val 1 val 2 Last edited by BJN01; 21.03.2020 at 00:39. |
#1277
|
|||
|
|||
![]()
@pspzockerscene, @Sokub : Happy I could help.
![]() Do you need help with the one which is still present in the post or is that the one you solved? |
#1278
|
|||
|
|||
![]()
yes , for the one still present in the post i need help , thank you
[that solved I deleted it ( =_=' ... I had a wrong path ... sorry)] |
#1279
|
|||
|
|||
![]() Quote:
Code:
var stdOut = callSync("cmd", "/c", "dir/b", "\\"); var array = stdOut.split("\r\n"); // Splitting string by lines vill result in an array var X = array[0]; var Y = array[1]; alert("X : " + X + "\r\nY : " + Y); |
#1280
|
|||
|
|||
![]() Quote:
Like if the page is not loaded after 10sec it should skip the request. Code:
browser.setConnectTimeout(10000); browser.setReadTimeout(10000); Code:
var browser = getBrowser(); try { browser.getPage("http://www.google.de/", 10000); } catch (e) { } Last edited by Heinz; 21.03.2020 at 17:24. |
![]() |
Thread Tools | |
Display Modes | |
|
|