JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #241  
Old 01.12.2017, 04:45
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 522
Default

@MaybeGrimm: It is possible to add metadata to a file, using the script, as long as the external program and the target file supports it. The script just passes the relevant variables to the external program. If you want to use 'exiftool', make sure you are able to add the metadata manually via CLI. Then, in the script, modify the path to 'exiftool' and the 'parameters' if necessary.
Reply With Quote
  #242  
Old 01.12.2017, 16:48
MaybeGrimm MaybeGrimm is offline
Super Loader
 
Join Date: Nov 2017
Posts: 27
Default

Quote:
Originally Posted by mgpai View Post
@MaybeGrimm: It is possible to add metadata to a file, using the script, as long as the external program and the target file supports it. The script just passes the relevant variables to the external program. If you want to use 'exiftool', make sure you are able to add the metadata manually via CLI. Then, in the script, modify the path to 'exiftool' and the 'parameters' if necessary.
I thought that just for being images (I want the Pinterest comments to appear in the comment metadata of the file) and considering I can put the metadata manually, it has to work. But apparently I can't make it with the CLI and exiftool (IDK if I'm doing everything right).
It's impossible to make it work with another program, right? I that case, I could use a single info-file :/
Sorry for the trouble.
Reply With Quote
  #243  
Old 01.12.2017, 16:54
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 522
Default

Quote:
Originally Posted by MaybeGrimm View Post
... I can't make it with the CLI and exiftool ...
Contact me in JD Chat. I can try to help you troubleshoot.
Reply With Quote
  #244  
Old 03.12.2017, 15:44
ottoS ottoS is offline
Vacuum Cleaner
 
Join Date: May 2013
Posts: 17
Default How to build an interactive script?

Quote:
Hi,

with the new trigger-functionality now we can start a script on button-press.
Very, very nice.
With this scenario I want to build an interactive script with an datetime-picker at script start.
For instance:
1. button pressed in JD-menu launches the script.
2. the script should launch a dialog box with a datetime-picker (at best there would be a cancel-button).
3. after input the script then processes the value ... (or abortes on cancel-button).

Now my question:
How to render the picker, because we have no html-canvas onto we can render the UI-elements (form, etc)?
(The only GUI-canvas I see is the alert-popup, but can it blown up to a multifunctional UI-element?)


Thx for reading this.
A lot more thanks for a reply.
Rückfrage von JIAZ:
Quote:
Originally Posted by Jiaz View Post
@ottoS: what for do you need the date picker exactly for? You could just let user enter input like hours:minutes:day...
Antwort von ottoS:
Ok, the date picker is nice, but separate inputs will also be fine.
But this brings me to my next question: How to render a self-composed input-dialog-UI with a bunch of canvas elements (label, input-fields, buttons) in the jd-desktop-GUI environment?

thx
__________________
Sys-Info: Win10Home32bit | NTFS | OracleJRE1.8 | JD2 with GUI
Reply With Quote
  #245  
Old 04.12.2017, 11:34
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 62,527
Default

Quote:
Originally Posted by ottoS View Post
How to render a self-composed input-dialog-UI with a bunch of canvas elements (label, input-fields, buttons) in the jd-desktop-GUI environment?

thx
That is not possible and I don't think that we will add support such feature in near future/at all. The moment that kind of gui is required, I think it makes more sense to code it outside of JDownloader and communicate via API with JDownloader
__________________
JD-Dev & Server-Admin
Reply With Quote
  #246  
Old 08.12.2017, 21:52
Agita Agita is offline
Baby Loader
 
Join Date: May 2013
Location: Hannover
Posts: 5
Default Several questions

Hi there Pls excuse me but i got some questions where this thread and the script-editor help-page didnt helped me out :(

1) Is it possible to handle the proxy list (instead of just accessing the environment variable)?
2) is there a function for links like mylink.hasStopMark() ?
3) is there a way to get proxy address of a link?
4) how to execute a scipt just once (if i wanna create an infinite while(true)-loop)
would setting "interval = 99999999....." do the job?
5) about the status string of the links (mylink.getStatus()) ... they are all localized. so I have to define a config var at the top of the script like this?
Code:
cfgstr.waitingNoConnection = "Keine Internetverbindung?";
...
if(link.getStatus() == cfgstr.waitingNoConnection) {
...
or is there a better way?

Many many thanks in advance

-----------------------------------------------------------------------------------
UPDATE:

Ok, I managed to create my own solution for the link status problem

But for the other of my points I didnt find any workaround yet :/

Last edited by Agita; 10.12.2017 at 16:57.
Reply With Quote
  #247  
Old 13.12.2017, 14:22
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 522
Default

Quote:
Originally Posted by Agita View Post
2) is there a function for links like mylink.hasStopMark() ?
API call can be used to get the stopmarkedlink, which can then be compared with 'mylink.'
Code:
var stopMarkedLink = callAPI("downloadsV2", "getStopMarkedLink");

Quote:
4) how to execute a scipt just once (if i wanna create an infinite while(true)-loop)
would setting "interval = 99999999....." do the job?
Tried the event trigger "Jdownloader started"? Mainly depends on the type of script. Can also build/use time based events.
Reply With Quote
  #248  
Old 14.12.2017, 13:04
Agita Agita is offline
Baby Loader
 
Join Date: May 2013
Location: Hannover
Posts: 5
Default

That stopMarkedLink-Thingy is neat Thank you
Well, the trigger "Jdownloader started" just gets called right after JD started and not when it has been started already and the script is beeing configured and saved.. But never mind I will find a way

And for the getStatus() behaviour I added an attachement with my solution and onetwo other things, if someone needs it
Attached Files
File Type: zip Jdownloader2-EventScripter-Library-master.zip (67.3 KB, 0 views)

Last edited by Agita; 14.12.2017 at 13:17.
Reply With Quote
  #249  
Old 15.12.2017, 19:58
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 62,527
Default

@Agita: What are you trying to achieve? Then we can provide more information/help better
__________________
JD-Dev & Server-Admin
Reply With Quote
  #250  
Old 19.12.2017, 12:11
donnje donnje is offline
Baby Loader
 
Join Date: Dec 2017
Posts: 9
Default

Quote:
Originally Posted by mgpai View Post
Code:
// Move finished non-archive files, to user defined folder
// Trigger required: "A Download Stopped"

var destFolder = "c:/myFolder/movedFiles"; // <- Set destination folder.

if (link.isFinished() && !link.getArchive()) {
    getPath(link.getDownloadPath()).moveTo(destFolder);
}
HI,
If I make a script test I have this error
RefereceError: "link" is not defined. (#6)
where am I wrong?
Reply With Quote
  #251  
Old 19.12.2017, 12:13
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 62,527
Default

@donnje: What trigger did you use? Please be aware that it depends on the set trigger what objects you can access
__________________
JD-Dev & Server-Admin
Reply With Quote
  #252  
Old 19.12.2017, 12:24
donnje donnje is offline
Baby Loader
 
Join Date: Dec 2017
Posts: 9
Default

Quote:
Originally Posted by Jiaz View Post
@donnje: What trigger did you use? Please be aware that it depends on the set trigger what objects you can access
on event script i make a new script and past the code
i put a none trigger
can you explain to me how I can do, please?
Reply With Quote
  #253  
Old 19.12.2017, 12:26
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 62,527
Default

Script will only work with a trigget that provides a link object. See the comment in script *Trigger required: "A Download Stopped"
__________________
JD-Dev & Server-Admin
Reply With Quote
  #254  
Old 19.12.2017, 12:39
donnje donnje is offline
Baby Loader
 
Join Date: Dec 2017
Posts: 9
Default

Quote:
Originally Posted by Jiaz View Post
Script will only work with a trigget that provides a link object. See the comment in script *Trigger required: "A Download Stopped"
i make a new script and i put on trigger "A Download Stopped" but don't worked, the downloaded file is not moved
sorry maybe Am 'I wrong script ?
I want the finished downloads to be moved to a dedicated folder

Last edited by donnje; 19.12.2017 at 12:42.
Reply With Quote
  #255  
Old 19.12.2017, 13:15
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 62,527
Default

Can you please show the complete script?
__________________
JD-Dev & Server-Admin
Reply With Quote
  #256  
Old 19.12.2017, 13:22
donnje donnje is offline
Baby Loader
 
Join Date: Dec 2017
Posts: 9
Default

Quote:
Originally Posted by Jiaz View Post
Can you please show the complete script?
I put

// Move finished non-archive files, to user defined folder
// Trigger required: "A Download Stopped"

var destFolder = "c:/myFolder/movedFiles"; // <- Set destination folder.

if (link.isFinished() && !link.getArchive()) {
getPath(link.getDownloadPath()).moveTo(destFolder);
}


Last edited by donnje; 19.12.2017 at 13:26.
Reply With Quote
  #257  
Old 19.12.2017, 13:25
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 62,527
Default

the script does not move archive parts, you know that?
__________________
JD-Dev & Server-Admin
Reply With Quote
  #258  
Old 19.12.2017, 13:27
donnje donnje is offline
Baby Loader
 
Join Date: Dec 2017
Posts: 9
Default

Quote:
Originally Posted by Jiaz View Post
the script does not move archive parts, you know that?
tnx for your patience
I don't understand
I would like to move the files I have completed to download to a specific folder, is it posible?
Reply With Quote
  #259  
Old 19.12.2017, 13:29
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 62,527
Default

yes, but the script does only move *non archive files*. Archive files are not moved to not break extraction
__________________
JD-Dev & Server-Admin
Reply With Quote
  #260  
Old 19.12.2017, 13:44
donnje donnje is offline
Baby Loader
 
Join Date: Dec 2017
Posts: 9
Default

my file is "no archive file" :(

Last edited by donnje; 19.12.2017 at 20:34.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 19:24.
Provided By AppWork GmbH | Privacy | Imprint
Parts of the Design are used from Kirsch designed by Andrew & Austin
Powered by vBulletin® Version 3.8.10 Beta 1
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.