{"id":774,"date":"2012-06-28T15:22:29","date_gmt":"2012-06-28T21:22:29","guid":{"rendered":"http:\/\/antone.geckotribe.com\/alpha-gecko\/?p=774"},"modified":"2026-10-24T13:40:05","modified_gmt":"2026-10-24T19:40:05","slug":"droplet-mac-os-for-launching-kindlegen","status":"publish","type":"post","link":"https:\/\/zeta.geckotribe.com\/alpha-gecko\/droplet-mac-os-for-launching-kindlegen\/","title":{"rendered":"Droplet (Mac OS) for Launching KindleGen"},"content":{"rendered":"<p>If you use Amazon's <a href=\"http:\/\/www.amazon.com\/gp\/feature.html\/?ie=UTF8&camp=1789&creative=390957&docId=1000765211&linkCode=ur2&tag=moulc\">KindleGen<\/a> program to generate Kindle eBooks on the Mac, I've got a little script for you that will enable you to drag-and-drop your source material and run KindleGen automatically, rather than having to open a Terminal window and type filenames and paths on the command line.<\/p>\n<p>Copy the following code and paste it into AppleScript Editor, and then save it as an Application. Once you've done that, you'll be able to drag and drop HTML files, .opf files, etc. onto it to create your Kindle eBooks.<\/p>\n<p>Note: you'll either need to put kindlegen in your Applications folder, or fix the path to it near the bottom of the code.<\/p>\n<div style=\"width:500px;overflow:auto;background-color:#e3e3e3;border:1px solid #ccc;padding:2px 20px;\">\n<pre>on replace_chars(this_text, search_string, replacement_string)\r\n   set text item delimiters of AppleScript to search_string\r\n   set item_list to text items of this_text\r\n   set text item delimiters of AppleScript to replacement_string\r\n   set this_text to item_list as string\r\n   set text item delimiters of AppleScript to \"\"\r\n   return this_text\r\nend replace_chars\r\n\r\non open filelist\r\n   tell application \"Terminal\"\r\n      activate\r\n      if (count of windows) is 0 then\r\n         do script \"\"\r\n      end if\r\n      repeat with i in filelist\r\n         tell application \"Finder\" to set parentFolder to quoted form of (POSIX path of ((folder of i) as string))\r\n         set fn to my replace_chars(name of (info for i), \" \", \"\\\\ \")\r\n         \r\n         do script \"cd \" & parentFolder in window 1\r\n         do script \"\/Applications\/kindlegen \" & fn in window 1\r\n      end repeat\r\n   end tell\r\nend open<\/pre>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>If you use Amazon's KindleGen program to generate Kindle eBooks on the Mac, I've got a little script for you that will enable you to drag-and-drop your source material and run KindleGen automatically, rather than having to open a Terminal window and type filenames and paths on the command line. Copy the following code and...<br \/>[<a class=\"moretag\" href=\"https:\/\/zeta.geckotribe.com\/alpha-gecko\/droplet-mac-os-for-launching-kindlegen\/\">read more<\/a>]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[],"class_list":["post-774","post","type-post","status-publish","format-standard","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/zeta.geckotribe.com\/alpha-gecko\/wp-json\/wp\/v2\/posts\/774","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zeta.geckotribe.com\/alpha-gecko\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zeta.geckotribe.com\/alpha-gecko\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zeta.geckotribe.com\/alpha-gecko\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zeta.geckotribe.com\/alpha-gecko\/wp-json\/wp\/v2\/comments?post=774"}],"version-history":[{"count":1,"href":"https:\/\/zeta.geckotribe.com\/alpha-gecko\/wp-json\/wp\/v2\/posts\/774\/revisions"}],"predecessor-version":[{"id":898,"href":"https:\/\/zeta.geckotribe.com\/alpha-gecko\/wp-json\/wp\/v2\/posts\/774\/revisions\/898"}],"wp:attachment":[{"href":"https:\/\/zeta.geckotribe.com\/alpha-gecko\/wp-json\/wp\/v2\/media?parent=774"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zeta.geckotribe.com\/alpha-gecko\/wp-json\/wp\/v2\/categories?post=774"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zeta.geckotribe.com\/alpha-gecko\/wp-json\/wp\/v2\/tags?post=774"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}