is a Mac OS X 10.5 and above Intel-only program from Amazon that compiles ebook source files into a Kindle format ebook.
Unfortunately, it's a command-line program that normally needs to be run by typing commands using the Terminal utility.
So I wrote an Applescript wrapper for Kindlegen. To use it, download and expand the attached zip file, which will give you the KindleGen Wrapper 2.1.app Applescript application. You can put this anywhere — perhaps in your Applications folder.
You'll also need the Mac OS X version of Kindlegen from Amazon, which can be found here: http://www.amazon.com/gp/feature.html?docId=1000234621
Expand the zip file from Amazon, which will give you a folder containing the kindlegen command-line application (called just "kindlegen") and a variety of notes and samples. I suggest you drag the kindlegen command-line application into the Applications folder.
To use the Applescript, just drag&drop an ePub file or a folder containing a suitable set of Kindle source files onto the KindleGen Wrapper Applescript.
For ePubs the kindle file will be created in the same folder as the ePub, with the same name but with a ".mobi" extension.
For folders, the Applescript will run KindleGen on the first .opf file it finds in any folder (including in subfolders), and create the compiled Kindle file in the folder that contains the folder that was dragged, named the same as the folder that was dragged, but with a ".mobi" extension.
You can drag multiple folders and/or ePub files at once.
Because the Applescript searches subfolders, it's possible to arrange your source files so that they are both a valid ePub folder, and valid source files for a Kindle file, and generate the Kindle file with this AppleScript, and the ePub file using my ePub Zip applescript.
If you just run the AppleScript by double-clicking it you'll be able to choose whether kindlegen is run with no compression (fast) or high compression (small). You'll also be shown which kindlegen command line application is being used, and be given an opportunity to choose a new one.
Comments, bug reports, etc., welcome.
This script now works only with kindlegen 1.2 and above, including the latest kindlegen 2.5.
If you want or need to strip the sources from the end of the generated Kindle file, or split out the Mobipocket and KF8 versions of the compiled file, see the MobiUnpack python script
. The AppleScript wrapper for the python script should be updated shortly.
New to version 2.0:
New to version 2.1
- Configuration Dialogs improved
- Compilation option (Fast/Small) is now a default. You can reverse the default by holding down the option key when drag&dropping.
- You can (if you wish) put the kindlegen command line application inside the KindleGen Wrapper package, in the Resources folder. The configuration dialogs will notice that it's there and give you the option of selecting it.