Kindlestrip Python script and AppleScript wrapper
Kindlegen 1.1 and later now always adds the source files used in compiling the kindle ebook as one of the (invisible) records in the kindle ebook.
So I wrote a python script that strips out the sources record from Kindle format ebooks. And for those on Macs I wrote a nice Applescript wrapper and also put the python script in the AppleScript bundle to make things easy.
Kevin Hendricks has since updated the code to handle files from KindleGen 2.x, and I've also tweaked a bit more to handle KindleGen 2.7.
If you're going to upload to the Amazon store, this script is definitely unnecessary, as Amazon will strip the sources before delivery anyway.
Do not use this script to make files to be uploaded to KDP.
But if you're going to upload the ebook somewhere else, (e.g. the MobileRead Library), you might well want to make the file as small as possible.
If you're on a Mac you only need the Applescript, as it includes the Python script in it. The Applescript is a simple drag&drop operation — drag your KindleGen generated file onto it, and it creates one named [oldname]_stripped.mobi.
As always, please comment with any bug reports or problems.
Last edited by pdurrant; 10-27-2012 at 06:47 AM.