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 10-20-2013, 06:48 PM   #1
Jimmbo
Junior Member
Jimmbo began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Oct 2013
Device: ipad/iphone
Using Applescript to Have Calibre Add a Doc For Conversion

I have an HTML file I frequently update. Each time, I use Calibre to convert the file into an epub.

I want to create an applescript that will make Calibre add the file (and, for extra points, start the conversion into an epub, as well....though I'll settle for just adding it).


I've started with this:
tell application "calibre" to open "Users/MyName/Documents/Doc.html"

....but it doesn't work (I'm assuming this is due to Calibre's non-standard way of opening files).

Can anyone help?
Jimmbo is offline   Reply With Quote
Old 10-21-2013, 12:25 AM   #2
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: 21,664
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Try using the CLI http://manual.calibre-ebook.com/cli/cli-index.html

BR
BetterRed is offline   Reply With Quote
Advert
Old 10-21-2013, 01:15 AM   #3
Jimmbo
Junior Member
Jimmbo began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Oct 2013
Device: ipad/iphone
Thanks. This script works:


-----------------
tell application "Terminal"
do script "calibre /Users/MyName/Documents/Doc.html"
end tell
-----------------


Can't trigger conversion, though. I've tried this:

-----------------
tell application "Terminal"
do script "ebook-convert doc.html doc.epub"
end tell
-----------------

....but Terminal says "Cannot read from /Users/MyName/Documents/Doc.html"
(though the doc exists), regardless of whether I've previously added doc.html to Calibre's catalog

Last edited by Jimmbo; 10-21-2013 at 01:32 AM.
Jimmbo is offline   Reply With Quote
Old 10-21-2013, 01:40 AM   #4
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
Posts: 13,381
Karma: 78877538
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
Jimbo; you probably need to ensure that full path's are being used when you try the convert; not just the file name.

ebook-convert is not designed to convert a book already in the calibre database; rather it's designed just to do a conversion without adding to the database.

Why not just open the terminal window and experiment with the commands directly, as opposed to using AppleScript?
PeterT is offline   Reply With Quote
Old 10-21-2013, 08:41 PM   #5
Jimmbo
Junior Member
Jimmbo began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Oct 2013
Device: ipad/iphone
Peter, yeah, I am futzing in Terminal, but was just trying to be consistent in the thread.

The command terminal help manual linked above does not say to specify file path for this particular action, so I assumed it was used to process files already added to the Calibre window.

But I've tried it both ways, and Terminal keeps reporting:

Cannot read from /Users/MyName/Documents/Doc.html
Jimmbo is offline   Reply With Quote
Advert
Reply

Tags
add, applescript, book, calibre


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Let's add DOC support Artiach Calibre 6 05-05-2011 11:29 PM
Doc Splitter-Macro or Add-in For Word 2003 konrad Workshop 0 03-08-2011 03:43 PM
Batch doc conversion webwizard Conversion 1 02-13-2011 11:59 PM
HELP!! Tables in doc. not right on Kindle after Conversion via Calibre MinaNoir Amazon Kindle 3 07-22-2010 01:42 PM
Any Chance Calibre Will Support Direct DOC Conversion? sirbruce Calibre 1 03-22-2009 05:14 AM


All times are GMT -4. The time now is 09:38 PM.


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