This HTMLConverter bundle is designed to aid in the reading of HTML formatted emails. This is done two ways, displaying and converting. Displaying is done by saving the email to a file and then passing the filename to an HTML browser through services. The filename is dynamically created to be different for each email reading. All created files are deleted when the bundle restarts, so that filenames can be reused. If you quit and restart this bundle without doing the same for your Browser, the files will be cached and you will have to reload each page until you get to new filenumbers. Converting is simply converting HTML tags into something that is less "visually annoying". It does NOT display HTML. It will convert any text to any other text. So it can be used to convert more than just HTML. This bundle is very simple. It does minimal data validation if any. It expects you to have done the basic setup work. The primary example is with the HTMLSavePathName default parameter. The program doesn't add a "/" if you forget it, and it doesn't create directories that don't exist. And at startup, it doesn't delete all old files in that directory. To set HTMLConverter defaults, the following are the appropriate default preference information from "dread -o Mail". None of these are required. They can be set by typing "dwrite" followed by the dread information listed below. Mail will have to be restarted for these defaults to be read-in and used. ***** Displaying ***** Mail HTMLDisplay YES This causes the email text to be saved in a file in HTMLSavePathName. That file is then opened using the service defined in HTMLServiceName. The default is YES. Mail HTMLSavePathName /tmp/<userName>/HTMLConverter/ This is the name of the directory to save the temporary files used to display the HTML in the Browser. You must include the "/" at the end. The directory must EXIST. The default is to save in /tmp/. Mail HTMLServiceName "OmniWeb/Open URL" The HTMLServiceName is the full name of the Services option to open a URL in a HTML Browser. The default is "OmniWeb/Open URL". ***** Converting ***** Mail HTMLConvert YES This causes HTML tags to be converted according to the HTMLMap.plist file found at HTMLMapPathFileName. The default is YES. Mail HTMLMapPathFileName ~/Library/Mail/HTMLMap.plist This causes conversion to be based on a file from somewhere other than inside the bundle wrapper. The default is to look inside the bundle wrapper. The HTMLMap.plist file contains key/value pairs of the format: "key" = "value"; If the semicolon is excluded, the remainder of the file will not be loaded. The value can contain printf style formatting (like \n for newline). To install / use any NeXTMail bundle, simply copy it into /LocalLibrary/Mail/ or ~/Library/Mail/ NeXTMail only accepts bundles in ONE of these locations. Ok, it is more complicated than that, but this is the easiest way to get it working. Once the bundle is in the "right" place, you will have to quit and restart Mail. The bundle will take effect immeditely. The idea for doing this was from one of my co-workers, Michael Pelz-Sherman <mps@is.com>. He suggested making a bundle, I took it from there. Vivian Girel <vivian@lutetia.infodesign.ch> had a good suggestion of an alternative: You can also play with the Message/MIME menu to obtain a readable MIME alternative... This bundle is public domain. It comes with no warranties or other guarantees. Although it should work. It is the independent work of the author and is not necessarily endorsed by my company, Integrity Solutions, Inc., it's management or owners. Send any questions, comments or humorous remarks to me Craig Laurent at cdl@is.com ========================================================== General enhancements: -put "/" at end of HTMLMapPathFileName if it isn't already there. -create directories that don't exist for HTMLMapPathFileName. -find a way to un-cache pages from the Browser, or force a reload. OpenStep/Rhapsody enhancement: Rather than a NXStringTable, use NSDictionaries. Both could be put in the same file. Get text and rtf dictionaries. copy text dict, then add values from rtf..this is the full rtf dictionary to use. **Of course if it is true that Rhapsody TEXT objects can display HTML, this won't be needed then.
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.