Mobileread
Automating Tasks in Calibre
#1  Thasaidon 01-08-2018, 02:13 AM
Hi

I have seen in other threads people asking if it is possible to automate repetetive tasks in Calibre. I will also admit to being one of them.

I did a few desultory searches for Windows macro creators but did not find anything that really looked as though it would do the job.

As an automating Calibre thread came up again a few days ago I did another search and found a freeware program that impressed me and will do the job.

It is called "Pulovers Macro Creator".

I have had a little play with it and found picking up the basics not too bad. There are tutorials, walkthroughs and set of video turorials online.

I will let you know how I get on with it
Reply 

#2  Katja_hbg 01-09-2018, 01:39 AM
Yes, please let me know your experience with that.

As I wrote in the other thread I am interested to run automated for a group of books:
- four prepared search-and-replace
- convert (all settings are done in the dialog, so only run)
- plugin count page
- plugin generate cover (values are set as default)
- plugin count authors

Of course there would be still manual work like setting my own tags and some other values as they are book depending.

So please let me know if you found something helpfull in this regards.
Reply 

#3  Thasaidon 01-09-2018, 05:06 AM
The program will certainly do the job but like many powerful programs (r.g. Calibre) it has a lot of options and commands which have to be learnt.

The first part of the automation I want means opening the Calibre editor automatically (for a book specified in Calibre Library view), using the icon bar to run certain operations and deal with the Report screens produced, wait while I deal with errors in the epub the editor has found after which it should save the epub and exit editor and start on part 2.

I am making progress though and have got about half of part one done. The thing that is slowing me down is that I am having to learn bow to use the program at the same time.

All good fun
Reply 

#4  Thasaidon 02-02-2018, 01:22 AM
Well I have finally got the first macro done and I am starting to get the hang of the commands I am using. I have however had to junk what I had done and start again several times. I also had some problems with a couple of programs which interfered (OneLoup and Jettico Firewall)

Basically the macro will take the book selected in library view and open it in Editor. It then performs a number of actions in editor (prettify, mend HTML, smarten punctuation, remove unused css, compress inages, and check book).

After running 'check book' it waits until 'enter' is pressed which allows me to correct the errors.

On pressing 'enter' it then saves the edited file and closes editor.

Creating the macro was complicated by the focus constantly changing from toolbar button, to pop up window to new screen. I had problems getting this right. The copy function often got it wrong (probably my fault).

I am now going to start on the next macro which I will chain to the one just finished.

Hope this is of interest. I'll be back.
Reply 

#5  Thasaidon 02-20-2018, 02:24 AM
I am continuing to make progress.

I reconsidered the workflow I was trying to recreate in the macro and realized it would be easier if I switched to processing books in batches rather than automating the one book at a time process I was doing manually.

It easy very easy to amend my first macro to this and I was able to half process over 100 books in in less than half the time it would take to do the same work manually. It only took so long because I stopped to fiddle with the macro code as I was going along. I still have a lot to learn about the macro commands.

I have now started amending the second macro and should have that completed soon and then I should really begin to whip through processing my library.
Reply 

#6  Inukami 02-21-2018, 11:36 PM
Hi @Thasaidon

It sounds like you have found a very good macro. I'm very interested in what you are able to do with it/automate. I'm assuming you are using Microsoft. I would greatly appreciate it if you could share the macros on this forum for use by other users.

I use both operating systems but I really mainly use the Mac currently for my Calibre library. For Mac, there is this useful tool called Automator which can automate tasks. I currently only use it to automatically add books to my library when I download them - Refer to this article. The equivalent of this for Windows is AutoHotkey and others. I would love to do more with Automator but it seems to be limited. I was wanting to post something on this forum about it as the article above may a bit outdated. There is also AppleScript but that might be a bit beyond me.

Inukami
Reply 

#7  Thasaidon 02-22-2018, 02:31 AM
Quote Inukami
Hi @Thasaidon

It sounds like you have found a very good macro. I'm very interested in what you are able to do with it/automate. I'm assuming you are using Microsoft. I would greatly appreciate it if you could share the macros on this forum for use by other users.


Inukami
Yes I am on Windows 7. The macro creator was written in AHK which is a Windows scripting language.

Basically I bring up a number of books in Library view and highlight the top one.

The first macro then takes the highlighted book and opens it in Editor. It then performs a number of actions in editor (prettify, mend HTML, smarten punctuation, remove unused css, compress inages, and runs check check book).

It then waits for a hot key to be pressed, which allows me time to correct any errors Check Book has found. I then press the hot key and the macro saves my changes and closes Editor and returns me to library view.

It then moves the highlight from the book just processed to the next one in line and repeats the process.

While the macro works, it undoubtedly could do with more work as I am only a newbie with the program and am still in the foothills of the learning curve. I have probably gone from London to Canterbury via Manila.

Macro 2 does something similar with Sigil and further processes books that have already been been processed with Macro 1.

I am more than willing to share these macros but they are specifically tailored to my workflow and are still works in progress. Once finalized then they can be turned into stand alone executables using AHK.

I want to look at some of the other simpler freeware macro creators as they may be better suited to simpler tasks. (e.g. running several several several saved searches in succession)
Reply 

#8  Thasaidon 02-22-2018, 02:41 AM
Quote Inukami
Hi @Thasaidon

There is also AppleScript but that might be a bit beyond me.

Inukami
I doubt it

All you need is the interest and to keep plugging away at it.

My wife is very intelligent and competent but runs to me with any PC question. Her real problem is she has NO interest in anything to do with the PC. This means no matter what I explain (however simple), or how often she has always forgotten the next time she needs the info.
Reply 

#9  sjfan 02-22-2018, 02:59 AM
Quote Thasaidon
Yes I am on Windows 7. The macro creator was written in AHK which is a Windows scripting language.

Basically I bring up a number of books in Library view and highlight the top one.

The first macro then takes the highlighted book and opens it in Editor. It then performs a number of actions in editor (prettify, mend HTML, smarten punctuation, remove unused css, compress inages, and runs check check book).

It then waits for a hot key to be pressed, which allows me time to correct any errors Check Book has found. I then press the hot key and the macro saves my changes and closes Editor and returns me to library view.
The macro thing is cool, I’ll just mention that the Polish books function does a lot of that with a simple click as well. It may not do everything you want, but it might help with at least part of your workflow.

https://www.mobileread.com/forums/sh...d.php?t=205857
Reply 

#10  Thasaidon 02-22-2018, 05:32 AM
Quote sjfan
The macro thing is cool, I’ll just mention that the Polish books function does a lot of that with a simple click as well. It may not do everything you want, but it might help with at least part of your workflow.

https://www.mobileread.com/forums/sh...d.php?t=205857
Too late the hero!

Thanks for the suggestion but in developing macros I got rid of the need to use Polish Books. Until then I used it routinely. I currently use Modify Books on all the books I process for reading.

I still use Polish Books if I just want to embed a new cover in an ePub.

Thanks for the interest. I will post how I get on with a simpler macro creator.
Reply 

  Next »  Last »  (1/2)
Today's Posts | Search this Thread | Login | Register