Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

An AppleScript droplet to ease .lit conversion Apps
There's no .lit reader for Macs. It's a proprietary format owned and strictly controlled by Microsoft. Nevertheless, there's a way to convert some .lit files to a readable format using a program called Convert LIT. Conver LIT can be a pain to use at the command line, so I wrote a quick ApplScript droplet for it.

In order for this to work, the Convert LIT binary must be in the invisible /bin folder on your boot drive, which will ordinarily require an admin password. To use, first copy my code. Then open the Script Editor and paste in the code, and save it as an application.

From that point on, you should be able to drag a .lit file onto your new application and have it "exploded" into a new folder containing the component JPEG images, HTML files, and Open eBook files. Please use the code to convert files that you legitimately own.

[robg adds: Please note that the compiled binary from the above site is named with a semi-obvious acronym. If I were to use that acronym here, however, it might cause macosxhints to get screened by some automated internet filtering programs, so I've chosen to refer to the program by its full name. In testing this hint, I found another .lit converter, the Open Convert-.LIT tool. I have no idea what, if any, relationship the two apps have, other than they seem to share the same four-letter acronym.]
    •    
  • Currently 2.43 / 5
  You rated: 1 / 5 (7 votes cast)
 
[83,904 views]  

An AppleScript droplet to ease .lit conversion | 21 comments | Create New Account
Click here to return to the 'An AppleScript droplet to ease .lit conversion' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
An AppleScript droplet to ease .lit conversion
Authored by: petieg on Jul 17, '06 07:59:51AM

Where is your code that you want us to use?



[ Reply to This | # ]
An AppleScript droplet to ease .lit conversion
Authored by: Hansi on Jul 17, '06 09:44:11AM
Hmm I made a small app that does the same thing and doesn't require you to install a binary in /bin/ a few months back for someone that needed it on apple.is:

http://www.hansr.net/Lit2html.dmg

[ Reply to This | # ]
An AppleScript droplet to ease .lit conversion
Authored by: Jerry Fletcher on Aug 28, '06 10:19:56AM

Hansi,

Your .lit conversion app works great. Very helpful.
Thanks so much.



[ Reply to This | # ]
An AppleScript droplet to ease .lit conversion
Authored by: rrc on Apr 01, '07 05:05:40PM

I should clarify - I am talking about Hansi's app that is suppposed to work by drag-and-drop



[ Reply to This | # ]
An AppleScript droplet to ease .lit conversion
Authored by: 6502 on Jul 17, '06 03:48:43PM
Robg seems to have cut out the code when he edited my hint to avoid using that evil word.

Here's the code with this important note: When you see "do shell script "/bin/c-l-i-t " in the code, change it to remove the dashes.

There's no other easy way to get it past the censor on this site.

on open dropped_file
	
	set file_path to quoted form of POSIX path of dropped_file
	set dropped_file to dropped_file as alias
	set file_info to info for dropped_file
	
	if kind of file_info does not contain "Document" then
		display dialog "This application only works on individual .lit files." buttons {"Ok"} default button 1
		error number -128
	end if
	if name of file_info does not end with ".lit" then
		display dialog "This application only works on Microsoft .lit files that adhere to appropriate naming conventions." buttons {"Ok"} default button 1
		error number -128
	end if
        -- REMOVE THE DASHES BELOW THIS LINE
	do shell script "/bin/c-l-i-t " & file_path & " " & file_path & "_Open_eBook/"
	
end open
I get asked about converting .lit files for the Mac every couple of months. I think this applet is likely to be very handy for some people.

[ Reply to This | # ]
An AppleScript droplet to ease .lit conversion
Authored by: wallybear on Jul 18, '06 07:06:46AM

other easy way to get it past the censor on this site is to substitute the line:

do shell script "/bin/c-l-i-t " & file_path & " " & file_path & "_Open_eBook/"

with

do shell script "/bin/cl" & "it " & file_path & " " & file_path & "_Open_eBook/"

this way the line will work with no need to re-edit it



[ Reply to This | # ]
An AppleScript droplet to ease .lit conversion
Authored by: el bid on Jul 20, '06 12:15:46AM

An acronym is an abbreviation formed from a pronouncable set of initials. The word we're shying from here is an abbreviation (in both known uses), it's pronouncable (except on MacOSXHints), but it's not a set of initials. So it's not an acronym.

Glad to have been of some use... :-)



---
el bid



[ Reply to This | # ]
An AppleScript droplet to ease .lit conversion
Authored by: chyna4xena on Aug 02, '07 05:59:55PM
That's not entirely true, an acronym is an abbreviation formed from a set of initial letters or word parts ("radar" is an acronym, as is "Interpol").

Also, the issue of pronunciation is only relevant to those who make a distinction between acronyms and initialisms, and most people do not make such a distinction.

So both the spelled-out variety ("FBI","ATM","BBC") and the as-a-word variety ("NATO","scuba","laser") are acronyms, as are combinations ("MS-DOS","CD-ROM","JPEG").

When referring to female anatomy, the word in question is an abbreviation. But when referring to the programme, it is most definitely an acronym, formed from "Convert LIT" (i.e. it is an acronym of an initial letter and a word part).


[ Reply to This | # ]
An AppleScript droplet to ease .lit conversion
Authored by: billblaskey on Oct 05, '06 12:00:39PM

I had to remove the first if statement to convert some files, but all in all great little app. Thanks!



[ Reply to This | # ]
An AppleScript droplet to ease .lit conversion
Authored by: terayon505 on Dec 05, '06 10:34:13AM

Sorry, this might be a dumb question but I'm pretty new to Mac OS X.

I have a bunch of .lit files and I want to convert them to something I can use. I think I can figure out how to use the above code in Apple Script but... how do I put my .lit files into a "/bin" folder? Where is this folder located?



[ Reply to This | # ]
now for html->lrf
Authored by: adinb on Feb 21, '07 12:04:31AM

What we need now is a little applet that will use either an "exploded" lit or the generated html to make an lrf. Obviously its pretty easy to save the html as pdf, but you lose all the pictures/metadata from the OEBPS/OPF (exploded lit).

So, anyone up to coding the important "last half" for OSX? Or did I miss it somewhere on sourceforge?



[ Reply to This | # ]
Batch Convert .Lit files
Authored by: arderenne on Feb 27, '07 03:07:13AM
I did a little tweaking and put this togeather, let me know what you think.

property type_list : {}
property extension_list : {"lit"}
on open these_items
	repeat with i from 1 to the count of these_items
		set this_item to item i of these_items
		set the item_info to info for this_item
		if (folder of the item_info is false) and 
			(alias of the item_info is false) and 
			((the file type of the item_info is in the type_list) or 
				the name extension of the item_info is in the extension_list) then
			process_item(this_item)
		end if
	end repeat
end open

on process_item(this_item)
	set file_path to quoted form of POSIX path of this_item
	set this_item to this_item as alias
	set file_info to info for this_item
	if name of file_info does not end with ".lit" then
		display dialog "This application only works on Microsoft .lit files that adhere to appropriate naming conventions." buttons {"Ok"} default button 1
		error number -128
	end if
	-- REMOVE THE DASHES BELOW THIS LINE
	do shell script "/bin/c-l-i-t " & file_path & " " & file_path & "_Open_eBook/"
	
end process_item



[ Reply to This | # ]
Batch Convert .Lit files
Authored by: sipatel on Jan 15, '10 02:36:41PM

I have taken the liberty of putting together the necessary binary and AppleScript application, with instructions, which can be downloaded here:

http://rapidshare.com/files/335907463/LIT2HTML.zip



[ Reply to This | # ]
An AppleScript droplet to ease .lit conversion
Authored by: rrc on Apr 01, '07 04:54:50PM

I couldn't make it work on my Aluminum PowerBook G4 under Tiger (10.4.9) by drag and drop. It opens, then closes, but the lit file is not translated. :-(

Any thoughts?



[ Reply to This | # ]
An AppleScript droplet to ease .lit conversion
Authored by: rrc on Apr 03, '07 06:09:47AM

Arderenne: the script worked flawlessly for me. Converted one lit file that the original version from 6502 refused to convert. (For some reason Haansi's applet did not work on my PowerBook G4 running Tiger, it opens and quits without converting the file.)



[ Reply to This | # ]
An AppleScript droplet to ease .lit conversion
Authored by: blackpaw on May 27, '07 11:41:37AM

If there are special characters in the filename (like apostrophy ' it refuses to work...

maybe a hint? ;)


ciao



[ Reply to This | # ]
An AppleScript droplet to ease .lit conversion
Authored by: melegar on Jul 31, '07 06:43:48PM


Hansi, your app is wonderful. Thanks a lot.



melegar



[ Reply to This | # ]
An AppleScript droplet to ease .lit conversion
Authored by: laramina02 on Apr 25, '08 09:38:56AM

thank you thank you! this is a terrific app.



[ Reply to This | # ]
An AppleScript droplet to ease .lit conversion
Authored by: kakubei on Jan 29, '09 02:25:28AM

Hansi, your app doesn't work under Intel OS X 10.5.6. It tries to open, then closes immediately.

Sure would be nice to be able to use it.

Thanks.



[ Reply to This | # ]
An AppleScript droplet to ease .lit conversion
Authored by: operius on Mar 03, '09 09:41:20AM

For pata,

Try just dragging & dropping the .lit file onto the Lit2html application. This worked for me.



[ Reply to This | # ]
An AppleScript droplet to ease .lit conversion
Authored by: forclaster on Apr 15, '10 03:32:21PM

I've actually been using a .lit reader for my mac for over a year now.

http://www.versiontracker.com/dyn/moreinfo/macosx/33061

Not only can Ma*censored* open .lit files, but it can easily save them to .pdf format.



[ Reply to This | # ]