samedi, mars 01, 2008

QuickLook on Leopard and OpenOffice.org

This is an awaited feature on Leopard ( i.e. Mac OS X 10.5 ) for Aqua version of OpenOffice.org. But there is no magic, and this is work in progress.

How does it work ? Just select a file, and hit space bar => a preview of your document does appear.

You want to see it in full screen ? just click expand. Close the preview ? escape it ..


Florian Heckl wrote a cws ( quicklookplugin01 ) and I played with the plugin yesterday evening.

First point. what does plugin mean ? Here, it's question of a little bundle, dealing with Mac OS X. Nothing to do for you. This is theory, because I faced several problems to make it work .. a bit.

First, Apple documentation says " the first place it will be searched is the bundle of the running application ".

Well ... I never could get it working, OpenOffice.org launched or not.

Luckily (what else with closed sources features ? ) all other places like ~/Library/QuickLook work.

Then, for some file formats, I could test. What I don't understand (maybe the cws has still some work to be done), is why it works using command line, and not in "direct" for all format files.

FYI, the magic command is qlmanage . See man qlmanage (needs Xcode to be installed) for further information.

qlmanage -r # to reset the detected plugins list
qlmanage -m # creates a new one


... and if you want to make the preview of say an .sxi file , just do :

qlmanage -r

Followed by (in one line) :

qlmanage -c org.oasis-open.document.text -p /path_to_the_file/finelame.sxi

Working extensions were .sxw , .sxi , .odt .sxc , .ods ( other are still untested by me).

As you can see, there is something odd : Apple modified org.oasis.opendocument.text in org.oasis-open.document.text. Else no way to make it work. Was it because TextEdit does either do preview of .odt itself, and to avoid a clash, Apple modified the file format name? No idea in fact, but at the occasion, I'll ask Apple people.

The current workaround is to insert a twice entry. And it seems to work. For the curious, you can have a look at the current list of available formats for preview there

I have read all the code in the cws, and if I'm not wrong, I think there is something possible, but I'll ask Florian first (he did everything).

If you want to test by yourself, I put an archive (INTEL only ) of the QuickLook plugin, and working with Aqua version there

Suggestions are welcome :)