Last October I posted about an Automator workflow for KindleGen. (Warning: Mac geek speak forthcoming.) I was pretty proud of it, but it had a bug, which is that it couldn’t handle spaces in the file’s path. For example, if your epub file is located in a folder named “Sparkly Vampire Novel,” which we both know it likely is, you’ll get an error message.
Now a reader named Ivo has provided a solution to the spaces problem. He’s using it with the “Run Shell Script” action so that KindleGen runs invisibly and you never see Terminal. I still prefer the Terminal way, because then I can watch for errors while KindleGen runs, but either approach will work.
I want to keep the info in one place, so I’ve updated the original post with the revised script. Please check it out if you use a Mac and KindleGen. With Ivo’s fix, it really does make mobi creation as simple as right-clicking on an epub or opf file, no matter where it’s located on your Mac.
“How to automate KindleGen on OS X”
(Photo: ChelseaWa)
By J. J. Markin March 17, 2011 - 1:23 PM
Wouldn’t it be a heck of a lot easier just not to put in the spaces in the first place? That’s what camel-backing, hyphens, or underscores are good for …
By Chris Walters March 17, 2011 - 1:38 PM
@J. J. Markin, That’s exactly what I was doing for the past 5 months or so, in fact, so that I didn’t run into this problem. But hey, now you can add spaces if you like!
By J. J. Markin March 17, 2011 - 3:57 PM
@Chris Walters — generational difference, perhaps; I may have gotten used to file names that were longer than eight dot three characters where the three characters were not necessarily tied to the application that could read the document, but file names with spaces still give me the shivers. I would never have run into the problem you describe because I would never have used those file names. Hence my reaction … Ah, well, I’ll dodder off to my bed in the old fogey home now! [laughter]