JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #1  
Old 26.01.2018, 18:17
k87
Guest
 
Posts: n/a
Default Open a .bat file when extraction ends

I have a .bat that deletes the MKV's title, not the filename. I'd like Jdownloader runs it when any extraction ends.

Or, is there another way to do this?
Reply With Quote
  #2  
Old 26.01.2018, 18:18
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 82,980
Default

You can use the eventscripter and then execute script after extraction
See here https://board.jdownloader.org/showthread.php?t=70525
Contact mgpai for help, he is our eventscripter master
__________________
JD-Dev & Server-Admin
Reply With Quote
  #3  
Old 26.01.2018, 19:27
k87
Guest
 
Posts: n/a
Default

I had already tried, but I don't know how to write it.

I'm contacting to mgpai.
Reply With Quote
  #4  
Old 27.01.2018, 09:47
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,700
Default

@k87:

Quote:
Originally Posted by mgpai View Post
Can use either of the following, with trigger "Archive extraction Finished".

Synchronous:
Code:
callSync("cmd","/c","c:/myFolder/myBatch.bat");

Asynchronous:
Code:
callAsync(function(){},"cmd","/c","c:/myFolder/myBatch.bat");
Reply With Quote
  #5  
Old 27.01.2018, 15:20
k87
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by mgpai View Post
@k87:
Thanks. But I've realized it didn't work. My .bat file have to be in the same extraction folder.

Is there any possibility to use the mkvpropedit directly with jdownloader each time when something is downloaded or extracted instead of my .bat file?

My batch code is this:

Code:
dir/b/s *.mkv >list.txt
for /F "delims=;" %%F in (list.txt) do "C:\Program Files\MKVToolNix\mkvpropedit" "%%F" --edit info --set "title=%%~nF"
del list.txt

Last edited by k87; 27.01.2018 at 15:35.
Reply With Quote
  #6  
Old 28.01.2018, 04:31
Statter Statter is offline
JD Legend
 
Join Date: Aug 2010
Posts: 541
Default

I'm pretty sure JD wont add the capability to add a program to do what your asking for but, I may be wrong also.

I would probably go to the User forums or to the Documentation mkvtoolnix.download/docs.html or User forums mkvtoolnix.download/community.html and ask there if there is a hidden Watch type folder maybe for the app(s) so that when something is finished via a JD finish the watch type folder action from your .bat script could then be run automatically so to speak .... one would also probably have the watch folder keep track of folders and files within so as not to keep reprocessing files already done .... it can get tricky and one can run out of disk space rapidly if things are not done right of course.

Good Luck
__________________
OS X !0.6.8 Mac Pro Intel (Workhorse)
OS X 10.13.6 MBP Intel 17" (Secondary)
OS X MBP Intel 15" Dual boot 10.6.8 and 10.13.6 (as needed)
Reply With Quote
  #7  
Old 29.01.2018, 09:52
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 82,980
Default

@k87: you can modify your batch file to change directory first and then provide the extraction directoy as parameter
Code:
callSync("cmd","/c","c:/myFolder/myBatch.bat",archive.getExtractToFolder());
__________________
JD-Dev & Server-Admin
Reply With Quote
  #8  
Old 31.01.2018, 13:25
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,700
Default

Quote:
Originally Posted by k87 View Post
... Is there any possibility to use the mkvpropedit directly with jdownloader each time when something is downloaded or extracted instead of my .bat file? ...
Pass the downloaded/extracted filepath to the call. For e.g.:

Code:
var sourceFile = link.getDownloadPath(); // Downloaded file
var mkvpropedit =  "C:/Program Files/MKVToolNix/mkvpropedit.exe"; // Path to mkvpropedit

callSync(mkvpropedit ,sourceFile,"--set", "\"title=\"");// Remove title
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 05:26.
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 - 2025, Jelsoft Enterprises Ltd.