Here is a Spotlight CHM (HTML Help, Compressed HTML) Metadata Importer that I wrote. It is written in python using chmlib and PyCHM. It takes each html page in the chm file, converts it to plain text, and applies that text to the kMDItemTextContent Spotlight attribute of the file.
]$ wget http://www.mattweber.org/files/chm-metadata-importer.tar.bz2 ]$ bzip2 -d chm-metadata-importer.tar.bz2 ]$ tar -xvf chm-metadata-importer.tar ]$ sudo mv CHM Metadata Importer.mdimporter/ /Library/Spotlight/
This plugin has only been tested on Intel Macs. Please make sure you have Python 2.5 installed before using this plugin.
I have been informed of a problem with the importer. It seems that CHMLib did not get packaged correctly and is failing on some systems. I have not had the time to figure out how to correctly package a library with xcode yet, but I have found a quick fix.
- Download CHMLib from http://www.jedrea.com/chmlib/
- Extract, and change into the chmlib directory.
- Run ./configure; make; sudo make install
Now the importer should run correctly. You can test it by typing:
mdimport -nfd4 file-to-import.chm