View Single Post
Old 10-25-2006, 10:18 AM   #1
FourOhFour
HTTP Error
FourOhFour ought to be getting tired of karma fortunes by now.FourOhFour ought to be getting tired of karma fortunes by now.FourOhFour ought to be getting tired of karma fortunes by now.FourOhFour ought to be getting tired of karma fortunes by now.FourOhFour ought to be getting tired of karma fortunes by now.FourOhFour ought to be getting tired of karma fortunes by now.FourOhFour ought to be getting tired of karma fortunes by now.FourOhFour ought to be getting tired of karma fortunes by now.FourOhFour ought to be getting tired of karma fortunes by now.FourOhFour ought to be getting tired of karma fortunes by now.FourOhFour ought to be getting tired of karma fortunes by now.
 
FourOhFour's Avatar
 
Posts: 86
Karma: 3000000
Join Date: Oct 2006
Device: Kindle Paperwhite
Mac OS X lit2rtf AppleScript thingy (Now with PDF goodness!)

I might be the only Mac guy here, but whatever. I just wrote an AppleScript that ties together convertlit, some XML parsing, and textutil to convert an unprotected lit file to a rtf. It even keeps the title and author from the lit file.

You'll need the OS X binary of Convert LIT, the XML Tools scripting addition, and, of course, the script.

[Edit to add: PDF support too! You'll need htmldoc. Easiest way to get it is with MacPorts.]

Once you download the script, you'll need to edit it (just double click on it) to tell it where you put convertlit and how big you want your text. Then just save it as an application, put it somewhere convenient, and drag and drop a lit onto it. Be patient (there's no progress display), and in a few seconds there should be a rtf in the same folder as the lit.
[Edit: For a PDF, rename the script lit2pdf or edit it to prompt for the format]

The code is ugly and poorly commented. I might fix that... eventually. Also, I've only tested it on two lit files. Your results may vary. Void where prohibited. Do not taunt happy fun ball.

Last edited by FourOhFour; 10-26-2006 at 06:11 PM.
FourOhFour is offline   Reply With Quote