12-11-2018, 04:40 PM | #1 |
Enthusiast
Posts: 37
Karma: 71294
Join Date: May 2016
Device: Sony DPT-RP1 and Pocketbook Touch Lux 2 and Basic
|
[MacOS] Help, using shell script and ebook-convert, hazel
Hi Calibre-Community,
I have a question about using the ebook-convert program from calibre in a shell script – as I am a total noob to shell scrips, maybe someone here can help me? I am eager to learn and would be very thankful! So I am using hazel on a mac to automate certain folders. Within one of the folders I want to have an automatic conversion from ePub to pdf. I stumbled over a very useful shell script in the internet, which can be used directly in hazel: https://jake.ch/2013/03/03/hazelbooks/ Code:
FULL_PATH="$1" ORIG_FILE=$(basename "$FULL_PATH") /Applications/Calibre.app/Contents/MacOS/ebook-convert "$ORIG_FILE" "converted/$(basename "$FULL_PATH" .epub).pdf" So I found the commands for the ebook-convert app from calibre: https://manual.calibre-ebook.com/gen...output-options But how can I include for example Code:
--custom-size |
12-11-2018, 08:19 PM | #2 |
creator of calibre
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
you simply add options to the end of the command line in the script
and if your want to change page size, IIRC the option is named --pdf-page-size run ebook-convert file.epub .pdf --help in terminal.app to get help on all the available options. |
Advert | |
|
12-12-2018, 05:15 AM | #3 |
Enthusiast
Posts: 37
Karma: 71294
Join Date: May 2016
Device: Sony DPT-RP1 and Pocketbook Touch Lux 2 and Basic
|
Thank you for your quick reply!
I got this in the log from hazel: Code:
command not found Is it possible to install the arguments without turning Off Rootless System Integrity Protection of MacOsX Mojave? |
12-12-2018, 06:08 AM | #4 | |
Enthusiast
Posts: 37
Karma: 71294
Join Date: May 2016
Device: Sony DPT-RP1 and Pocketbook Touch Lux 2 and Basic
|
Ah, I have got it –*but I am not sure what did the trick.
I downloaded the Xcode Command Line Tools from the apple developers page. Then I used the terminal phrase from this threat: https://www.mobileread.com/forums/sh...d.php?t=264945 Quote:
I will write a full workflow with Hazel and Shell Script this evening in here! Thanks for your help! |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Shell script to search all the libraries | loviedovie | Development | 0 | 02-17-2015 10:12 AM |
Shell Script Kindle 4nt | nixlos | Kindle Developer's Corner | 3 | 08-12-2014 12:46 PM |
invoking sql in a shell script | Mingyar | Kobo Developer's Corner | 17 | 05-31-2013 06:50 PM |
pdf to txt shell script | Mr.Castro0o | 0 | 03-27-2013 07:39 AM | |
Perl script for ebook-convert | gucky | Calibre | 3 | 01-11-2011 12:51 PM |