01-07-2019, 01:33 AM | #1 |
Fanatic
Posts: 516
Karma: 32106
Join Date: Feb 2012
Device: Onyx Boox Leaf
|
Open With (.bat): How does it work?
Dear Kovid,
I would like to use a .cmd file (or .bat) to run script on the epub (basically to push it to Content Server (linux). Normally I can drag the file on to the .bat file and it runs fine. But when I use Openwith feature (not the plugin), it does nothing. This is a simple sample: Code:
@echo off cls echo %1 timeout /t 5 exit |
01-07-2019, 06:34 AM | #2 |
creator of calibre
Posts: 43,844
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
should work just like that, but I dont currently have access to a windows computer to test.
|
01-07-2019, 07:51 AM | #3 |
Grand Sorcerer
Posts: 11,734
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
The above script works fine on my Win10 machine. When I drag a book from calibre I see the filename echoed, it counts down 5 seconds, then it closes.
|
01-07-2019, 09:38 AM | #4 |
creator of calibre
Posts: 43,844
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
I think the OP is saying it works with drag and drop but not with open with (which you access by right lcicking the format in the book details panel and choosing open with)
|
01-07-2019, 09:54 AM | #5 |
Fanatic
Posts: 516
Karma: 32106
Join Date: Feb 2012
Device: Onyx Boox Leaf
|
Yes, that is what I am trying to do.
|
01-07-2019, 01:09 PM | #6 |
Grand Sorcerer
Posts: 11,734
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Yea, "open with" doesn't work with bat files. It doesn't execute the bat file. I played with the source for a while and couldn't make it work.
|
01-07-2019, 01:32 PM | #7 |
Enthusiast
Posts: 34
Karma: 1681374
Join Date: Jan 2018
Location: Great White North
Device: Glowlight 3, Kindle Keyboard, android, apple...
|
I would add a short cut to the batch file in the sent to of the right click menu.
Run "shell:sendto" then past shortcut into the folder. |
01-07-2019, 03:59 PM | #8 | |
null operator (he/him)
Posts: 20,559
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
@nqk - I have a vague memory that something the Open With plugin can do, that the built-in Open With can't do, is execute .bat files - but I am by no means certain. Give it a try. BR |
|
01-07-2019, 06:44 PM | #9 | |
Bibliophagist
Posts: 35,312
Karma: 145435140
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Quote:
Last edited by DNSB; 01-07-2019 at 07:10 PM. |
|
01-07-2019, 10:49 PM | #10 | |
Fanatic
Posts: 516
Karma: 32106
Join Date: Feb 2012
Device: Onyx Boox Leaf
|
Quote:
@BetterRed, I've tried the OpenWith plugin, but it did not work out. |
|
01-08-2019, 12:26 AM | #11 |
null operator (he/him)
Posts: 20,559
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
FWIW - the JobSpy plugin has a tool to run arbitrary programs, including .bat files, viz
But it doesn't pass arguments, so maybe Open With could adopt whatever it does, or JobSpy could be enhanced to pass an argument. BR |
01-08-2019, 11:40 PM | #12 |
creator of calibre
Posts: 43,844
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Open a ticket for it and I will look into it when I have a moment.
|
01-08-2019, 11:44 PM | #13 | |
null operator (he/him)
Posts: 20,559
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
BR |
|
01-08-2019, 11:58 PM | #14 | |
Fanatic
Posts: 516
Karma: 32106
Join Date: Feb 2012
Device: Onyx Boox Leaf
|
Quote:
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Linux] "Click to open" links don't work | drawson1 | Calibre | 2 | 01-28-2017 08:00 PM |
Why would a book PDF work ok as a file, but not open in Calibre? | willbeaufoy | Calibre | 3 | 07-13-2016 02:43 PM |
Touchscreen not work when open device. | Lenorav | Amazon Kindle | 4 | 05-23-2015 07:35 PM |
[bug] problem using calibreportable.bat | Dopedangel | Calibre | 4 | 12-22-2010 03:47 AM |
Humor Wodehouse, P.G.: The Gold Bat. v1. 2 Jul 07 | HarryT | BBeB/LRF Books (offline) | 0 | 07-02-2007 07:45 AM |