Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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.

thanks,

ian.

share|improve this question

migrated from stackoverflow.com May 3 '11 at 10:49

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

add comment

1 Answer

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
add comment

Your Answer

 
discard

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.