08-01-2011, 07:34 AM | #1 |
Zealot
Posts: 122
Karma: 164
Join Date: Aug 2010
Location: Old Ynysybwl
Device: Sony PRS-300
|
I want to write a script....
I want to automate a task I carry out repetitively. In MS Word I would record a macro, but I guess that is going to be a lot tougher here in Calibre. The tasks I want to automate are:
1. Convert selected in ebooks in current library from RTF to ePub - with global preferences 2. Delete RTF format from selected books 3. Copy Same books to another existing library (always the same one) 4. Convert Same books to Mobi using same preferences 5. Delete epub format from same books 6. "Copy and Delete Afterwards" Mobi to another named Library (always the same one. I currently have 3 libraries. One for books requiring processing (all in RTF), and then a separate library each for epub and mobi (don't ask why, but there is a reason for that little madness). How easy would it be for me to write such a script - where do I start? If not native within Calibre, is there a reasonable external macro program avail for Windows? Regards |
08-01-2011, 07:52 PM | #2 |
Wizard
Posts: 1,065
Karma: 858115
Join Date: Jan 2011
Device: Kobo Clara, Kindle Paperwhite 10
|
It sounds to me like it'd be a start towards a plugin, in which the choices of which format for batch processing at each step could be globally defined once by user: (1) format conversion from origin to target, (2) delete whatever global format list is set, (3) copy user-defined format to user-defined library. The rest of that seems redundant to me. The error checking and safeguards against global castasphrophe seem like it would be a headache to implement though. At present calibre already does all of that to whatever is selected without scripting anything special, just in a series of smaller steps. I'm not sure the convenience of a 1-click batch "do-a-lot-things" would outweigh the dangers of screwing up the libraries by forgetting or mistaking what choices were globally set. Anyway, I'm not a plugin developer so I am not speaking from experience. But plugin stuff here in the calibre forum and in the manual is where I'd start if I wanted to integrate scripted actions into calibre. Perhaps the developer's forum might be helpful too.
|
Advert | |
|
08-01-2011, 07:59 PM | #3 |
Wizard
Posts: 1,065
Karma: 858115
Join Date: Jan 2011
Device: Kobo Clara, Kindle Paperwhite 10
|
Why? I have a personal ideosyncratic requirement to process books in 1 library, and to keep processed books in another library. It makes sense to me to keep them separated. But what fuels the requirement to keep them segregated by format?
|
08-02-2011, 05:09 AM | #4 | |
Zealot
Posts: 122
Karma: 164
Join Date: Aug 2010
Location: Old Ynysybwl
Device: Sony PRS-300
|
Quote:
I understand I could get to grips with Python to write a specific plugin, but no thanks, it is beyond my capabilities. I have looked and downloaded several books and read a couple of tutorials. My needs are too immediate. I can't get to the Help site whilst at work, and have little time when home, so I wondered if there was a reasonable macro program which emulated keypresses that works with calibre that someone could recommend. Or is there a script process within Calibre which is easy to learn and I could develop something in. |
|
08-02-2011, 05:50 AM | #5 |
Grand Sorcerer
Posts: 11,741
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
There is no scripting process inside calibre GUI other than plugins and python programs run in calibre's context (calibre-debug -e).
You can do some, perhaps all, of what you want to do using the command line, which can be scripted using .bat files (assuming you are using windows). The multi-library stuff won't be straight-forward, requiring an export, and import, and then a delete. It also won't be trivial to do the searching to get the book IDs to operate upon. As for GUI keypress macro programs, I have no idea. Google finds http://www.autohotkey.com/ as well as others. |
Advert | |
|
08-02-2011, 07:10 AM | #6 | |
Zealot
Posts: 122
Karma: 164
Join Date: Aug 2010
Location: Old Ynysybwl
Device: Sony PRS-300
|
Quote:
I am proficient in writing .bat files and had forgotten the command line facility - silly me. (yep I have been around from b4 the web and can still fire up my Fidonet programs Allfix etal as well as all the Proboard stuff BBS - oh happy days. LOL!!!) Thanks for googling that program for me, I will check it out later. It could do just the job. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Why do you write? | J.H. Farr | Writers' Corner | 42 | 10-27-2010 12:11 PM |
Who do YOU write like? | GraceKrispy | Lounge | 20 | 10-20-2010 10:41 PM |
I Write Like | Moejoe | Writers' Corner | 15 | 07-30-2010 09:44 PM |
Would you like to write with me? | Elliot | Writers' Corner | 0 | 12-29-2009 12:09 PM |
Write Fast, Write Slow? | Moejoe | Writers' Corner | 14 | 03-25-2009 09:55 AM |