Monday, March 02, 2009

How to convert .lit files to .htm on a Mac

Don't want to read all this crap? Go straight to the answer by clicking here.

Not that I use this blog for a lot of computer stuff, but this is an issue I tried to solve over a year ago and wasn't able to. Finally figured out how to do it, thank god, so I figured I'd post in hopes that anyone else searching for help would find this.

Before I begin: This article has nothing to do with anatomy or romance... just cold, boring technology. So keep in mind that I use the word "clit" only in terms of filenames and commands. Sorry to disappoint you.

So I want to make a post about the whole .lit/Mac thing. If you're like me and have a Mac but also have .lit files you'd like to read, you probably hate Microsoft. Well, maybe not, but you're probably annoyed at the fact that .lit is a file that only opens on Microsoft, and converting the .lit files to a readable format on Mac isn't very easy. Even googling it still requires a bit of reading and effort... so hopefully I can help make that easier.

Now, if you're like me, you probably googled .lit mac os x open files pdf html txt rtx doc wpa read help hate f&*k Microsoft ... etc.

One of the first things that comes up on google when you're searching this stuff is the the convertlit app (if you can call it an app). When I had tried this in the past, I had had no success.

Let's go over the process of when you download convertlit:
OK: So you download the clit file, and open it. It will open in Terminal, with a window giving (in my opinion, incomplete) instructions. It tells you there are three options for converting the .lit file, but the first is the only method we will be using, as the second and third options just convert a .lit file into another form of .lit file - which will still not open on a Mac, and therefore is useless to us.

Note that in the terminal window that the clit instructions opened in will not allow you to type anything else. To start working, you will need to open a new window in Terminal (command n).

Now, the direction it gives you is to type your form of the following into Terminal:

clit ebook-propietary.lit ebook-oebps\


So, if you're like me, you put in something like the following:

clit AtlasShrugged.lit AtlasShrugged\


After which, Terminal will give you the following error:

-bash: clit: command not found


Now, thanks to this forum topic I was able to figure out that this is because Terminal has no idea what clit is (no jokes, please). The reason Terminal can't find clit is because we haven't told Terminal where clit is.

I've only used Terminal a few times before, and by now I've figured out that if you're going to be dealing with files on your hard drive, you have to tell Terminal the file's path: the specific location of the file. If you give Terminal a file to work with without specifying a path, Terminal will not know what you're talking about. The base drive Terminal assumes is the Macintosh HD folder, but even if you are referencing a file in that folder, you can't just type the file name.

For example, even if I put the files I'm working with in the Macintosh HD folder, the following would not work:

clit AtlasShrugged.lit AtlasShrugged


OK, if Terminal assumes each file is in the Macintosh HD folder, and each file IS in the Macintosh HD folder, why isn't it working? You need to define the path. In this case, the since we are working in the base folder, we have to start the path for each location with a /.

So, assuming you've got the clit file, the .lit file, and the folder you want the "explosion" to happen in all located in the Macintosh HD folder, what do you do to get terminal to actually realize that?

/clit /AtlasShrugged.lit /AtlasShrugged


Now, doing that is kind of annoying if you don't feel like moving your files around constantly. So, instead of switching everything to the Macintosh HD folder, one thing you can do is to type out the LONG path of where your stuff is.
You could end up spending HOURS typing out a novel like this:

/Users/skweeds/Downloads/clit /Users/skweeds/Downloads/Transmit/Books/AtlasShrugged.lit /Users/skweeds/Documents/Books/AynRand


Now, if you're like me, you really don't want to type all that out. Also, if you're NOT like me, you probably don't have your Mac account name as "skweeds", so the copy/paste/adapt method might not really work in this situation.

There is good news: I just saved a bunch of money on my car insurance. Ok, that was a joke. Better news: It can be REALLY EASY to do, using Drag & Drop! I stopped using PCs for personal use in 2003, and I believe they had the drag-and-drop feature then, but I really don't think they've made it as useful as Mac has.

The short answer on how to use ConvertLit in Terminal


1. Download & unzip the clit app. As long as you know where it is, the location of the file doesn't matter.
2. Open a new terminal window.
You should see something like this:
Last login: Sun Mar 1 23:14:44 on ttys001
macbook:~ skweeds$

The specifics don't matter, just as long as you have a prompt available where you can type (but you don't need to type).
3. Drag and Drop these items from the Finder into the window in Terminal you have open (in this order):
I. clit file
II. whatever.lit file you want to convert
III. the Folder you want the .lit file contents to end up in.
As you drop in these items, Terminal will add their location to the command line. You don't need to press space or type anything.
4. Press return and let Terminal do its work. When it's finished, Terminal should read something like:
Exploded "/Users/skweeds/AtlasShrugged.lit" into "/Users/skweeds/AtlasShrugged/".

VoilĂ , you will have your ebook in readable files in the folder you chose.

When I used this method, I got .htm files of the table of contents & the actual story. I also got a few cover images, and an .opf file. I opened the opf in TextEdit and it kind of looks like an HTML source file, with links to each chapter and also images... "pocketpc" appears a couple times in the script, so I guess that's what it's for.
Anyway, everything you need will be there. So, enjoy!
I hope this saves you some time.
Note: I know there is lit2html out there, but it does not work for me. Boo!
Anyway, HAPPY READING!
You might want to check out spreeder.