View Single Post
Old 06-30-2013, 03:52 PM   #6
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,542
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by Doitsu View Post
As HarryT has already correctly pointed out, you can simply add the -c2 switch after Kindlegen, however, since Kindlegen will run several optimization passes for each file, I wouldn't recommend using the -c2 switch in batch files.



Assuming that you have ActivePython (or another Python 2.7 build) installed and Kindlestrip.py is the same folder as the batch file, you could use the following very simple batch file:

Code:
DEL conversion.log
FOR %%f IN ("*.epub") DO  (
	kindlegen "%%f" >> conversion.log
	IF EXIST "%%~nf.mobi" (
		ECHO ******************************* >> conversion.log
		kindlestrip "%%~nf.mobi" "%%~nf.new" >> conversion.log
		IF EXIST "%%~nf.new" (	
			DEL "%%~nf.mobi"
			REN "%%~nf.new" "%%~nf.mobi"
		)
	) 
)
The batch file works with KindleGen 2.9 and Kindlestrip 1.35.
Very nice script! And if you have a folder only with .mobi books and want to apply kindlestrip, how would it be the .bat file? Many thanks in advance.
RbnJrg is offline   Reply With Quote