You could do this using a Python code action in action chains. It seems that the steps would be:
- Send the epub formats to disk. Use a known directory as the destination.
- Invoke the python action to change the epubs to kepub.epubs in the known directory by scanning the directory for epubs that aren't kepub.epub.
The python action would scan the directory (tree) for .epub without being .kepub.epub. For each file found, convert it by calling
Code:
calibre.ebooks.oeb.polish.kepubify.make_options()
setting the options as you wish, then
Code:
calibre.ebooks.oeb.polish.kepubify.kepubify_path()
setting "outfile" to the basename of the epub + ".kepub.epub". Finally, delete the source epub.
I haven't tried writing and running the code but it seems straight-forward.
EDIT: Of course, you could do the same thing using a python script, which might be a better solution because the script can take arguments more easily than the action.