Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 01-07-2019, 01:33 AM   #1
nqk
Fanatic
nqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beauty
 
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
nqk is offline   Reply With Quote
Old 01-07-2019, 06:34 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
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.
kovidgoyal is offline   Reply With Quote
Old 01-07-2019, 07:51 AM   #3
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,734
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by kovidgoyal View Post
should work just like that, but I dont currently have access to a windows computer to test.
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.
Attached Thumbnails
Click image for larger version

Name:	Clipboard02.jpg
Views:	103
Size:	33.6 KB
ID:	168904  
chaley is offline   Reply With Quote
Old 01-07-2019, 09:38 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
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)
kovidgoyal is offline   Reply With Quote
Old 01-07-2019, 09:54 AM   #5
nqk
Fanatic
nqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beauty
 
Posts: 516
Karma: 32106
Join Date: Feb 2012
Device: Onyx Boox Leaf
Yes, that is what I am trying to do.
nqk is offline   Reply With Quote
Old 01-07-2019, 01:09 PM   #6
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
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.
chaley is offline   Reply With Quote
Old 01-07-2019, 01:32 PM   #7
GreyWolfsGhost
Enthusiast
GreyWolfsGhost ought to be getting tired of karma fortunes by now.GreyWolfsGhost ought to be getting tired of karma fortunes by now.GreyWolfsGhost ought to be getting tired of karma fortunes by now.GreyWolfsGhost ought to be getting tired of karma fortunes by now.GreyWolfsGhost ought to be getting tired of karma fortunes by now.GreyWolfsGhost ought to be getting tired of karma fortunes by now.GreyWolfsGhost ought to be getting tired of karma fortunes by now.GreyWolfsGhost ought to be getting tired of karma fortunes by now.GreyWolfsGhost ought to be getting tired of karma fortunes by now.GreyWolfsGhost ought to be getting tired of karma fortunes by now.GreyWolfsGhost ought to be getting tired of karma fortunes by now.
 
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.
GreyWolfsGhost is offline   Reply With Quote
Old 01-07-2019, 03:59 PM   #8
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,559
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by GreyWolfsGhost View Post
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.
How do you get the calibre Open With to use the .lnk file in shell:sendto to exec the bat file.

@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
BetterRed is online now   Reply With Quote
Old 01-07-2019, 06:44 PM   #9
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
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:
Originally Posted by BetterRed View Post
How do you get the calibre Open With to use the .lnk file in shell:sendto to exec the bat file.

@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
Not sure about this but I have a vague memory the last time I tried opening a .bat/.cmd file with Open With, it spit out a error about cmdline not being defined. Could be an error on my part in configuring the entry and not important enough that I spent time trying to troubleshoot it. I think this broke around the time that v1.52 or 1.53 was released.

Last edited by DNSB; 01-07-2019 at 07:10 PM.
DNSB is offline   Reply With Quote
Old 01-07-2019, 10:49 PM   #10
nqk
Fanatic
nqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beauty
 
Posts: 516
Karma: 32106
Join Date: Feb 2012
Device: Onyx Boox Leaf
Quote:
Originally Posted by GreyWolfsGhost View Post
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.
This trick works, but it still requires the use of Windows Explorer. I'm hoping to use the built-in OpenWith feature of Calibre. Very convenient.

@BetterRed, I've tried the OpenWith plugin, but it did not work out.
nqk is offline   Reply With Quote
Old 01-08-2019, 12:26 AM   #11
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
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

Click image for larger version

Name:	1.jpg
Views:	96
Size:	237.0 KB
ID:	168917

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
BetterRed is online now   Reply With Quote
Old 01-08-2019, 11:40 PM   #12
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
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.
kovidgoyal is offline   Reply With Quote
Old 01-08-2019, 11:44 PM   #13
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,559
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by kovidgoyal View Post
Open a ticket for it and I will look into it when I have a moment.
Done ==>> https://bugs.launchpad.net/calibre/+bug/1811045

BR
BetterRed is online now   Reply With Quote
Old 01-08-2019, 11:58 PM   #14
nqk
Fanatic
nqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beauty
 
Posts: 516
Karma: 32106
Join Date: Feb 2012
Device: Onyx Boox Leaf
Quote:
Originally Posted by BetterRed View Post
Gosh. That's great. Thank you.
nqk is offline   Reply With Quote
Reply


Forum Jump

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


All times are GMT -4. The time now is 03:42 AM.


MobileRead.com is a privately owned, operated and funded community.