Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there any way to specify the output filename and directory that qlmanage uses?

We are using qlmanage to convert word documents to HTML, and it writes Preview.html to its temp directory. You can specify the output directory with -o, so right now we create a new directory for each file we write, which works fine, but... not optimal.

No mention of such a facility in the command line options, but i thought i'd ask in case there is some undocumented trick.



share|improve this question

migrated from May 3 '11 at 10:49

This question came from our site for professional and enthusiast programmers.

up vote 4 down vote accepted

You can use textutil to convert Word documents to HTML and specify the output filename; it uses a different converter, though, which may not be acceptable for your uses.

With regard to qlmanage, you're abusing Quick Look here already. The output is a directory, not a file, which is only designed for Quick Look to consume. That Preview.html is a fixed filename is by design; otherwise the Quick Look displayer wouldn't know where to start. That you're able to extract the HTML output yourself is a nice side effect, nothing more.

share|improve this answer
Thanks Nicholas, that is what i expected, but thought i'd ask. The quality of the HTML that qlmanage creates is pretty excellent, do you know if textutil uses the same libraries? – ipd May 3 '11 at 2:25
Nope (I addressed this in my the first sentence of my response). Apple has 3 different Office importers/exporters: the doc/docx I/O in Cocoa Text (which is what textutil uses), the iWork importers/exporters (*Compatibility.framework, which you'll find in the bundles of each iWork app), and the Quick Look/iOS previewers (the private OfficeImport.framework). The latter two share quite a bit of code, and tend to be more robust/capable because they support the iWork feature set rather than just that of Cocoa Text. – Nicholas Riley May 3 '11 at 3:39
Ok, thanks for your expertise! – ipd May 3 '11 at 4:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.