Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Programming / Writing Quick Look (QuickLook) Plug-in (plugin) Snow Leopard

I have been doing a little research the past few days on writing/programming quick look plug-ins. So far I have found this apple developer page.

http://developer.apple.com/mac/library/documentation/UserExperience/Conceptual/Q uicklookProgrammingGuide/Introduction/Introduction.html

I also found these videos on youtube discussing the steps required to create a quick look plug-in.

http://www.youtube.com/watch?v=GMNSU-PIoOo <- Part 1
<a class="jive-link-external-small" href="http://">http://www.youtube.com/watch?v=3ctx5G3f3rM <- Part 2

Then I stumbled upon these websites that distribute quick look plug-ins.

1) <a class="jive-link-external-small" href="http://">http://www.quicklookplugins.com/
2) http://www.qlplugins.com/

The second link listed has a section for people developing quick look plug-ins, but after reading the wiki, it seems to cover integrating quick look into a mac os x application rather writing a plug-in for a specific file type.

Basically I wanted to write a quick look plug-in that can handle text files with a different file extension than .txt At the current moment quick look only previews/renders a quick look of text files that have an extension of ".txt".
My thought process on the matter was to create a quick look plug-in for TextEdit that can handle the file extension I want to preview in quick look. I know I can edit the ".plist" file on TextEdit and get the support for the file extension but that is not the route I want to go. I would rather learn how to write a quick look plug-in. The guy who posted this quick look plug-in is what I want to learn how to write/program.

http://whomwah.github.com/qlstephen/

I tried looking at his source code for the project to see how he wrote the quick look plug-in, but I did not quite understand how he wrote the plug-in in xcode.

So my question, what is the best way to write a quick look plug-in that can render/preview different file types other than ".txt"?

If anyone has expierence on this topic I would not mind hearing how you wrote your quick look plug-in.

cheers & Happy New Years.

mbp, Mac OS X (10.6.2)

Posted on Jan 1, 2010 3:39 PM

Reply
Question marked as Best reply

Posted on Jan 1, 2010 3:44 PM

iPatch wrote:
So my question, what is the best way to write a quick look plug-in that can render/preview different file types other than ".txt"?

If anyone has expierence on this topic I would not mind hearing how you wrote your quick look plug-in.


Just start with the QuickLook Generator template in Xcode. There is a "shortcut" way to do QuickLook plugins by formatting your output into HTML and letting WebKit do the work. I strongly encourage that method. I was able to write my first QuickLook plugin (for DBF files) in a couple of hours.
3 replies
Question marked as Best reply

Jan 1, 2010 3:44 PM in response to chris.jones1

iPatch wrote:
So my question, what is the best way to write a quick look plug-in that can render/preview different file types other than ".txt"?

If anyone has expierence on this topic I would not mind hearing how you wrote your quick look plug-in.


Just start with the QuickLook Generator template in Xcode. There is a "shortcut" way to do QuickLook plugins by formatting your output into HTML and letting WebKit do the work. I strongly encourage that method. I was able to write my first QuickLook plugin (for DBF files) in a couple of hours.

Jan 1, 2010 4:39 PM in response to chris.jones1

iPatch wrote:
I do not need to generate HTML output. I just want the output to generate the ASCII characters typed into the file. So I just want a quick look plug-in that outputs ASCII text.


I'm not talking about the output, but, rather, the input. The function "QLPreviewRequestSetDataRepresentation" is the important one. You need to give it something it can understand. HTML is the richest content that it understands. If you can display what you want in HTML, you can make your QuickLook plugin display it too. This function also accepts images, PDF, XML, text, RTF, movies, and audio. If you are only displaying text, you can just give it text. You probably will not have much control over how it displays your text, however. If you don't like the way your text is displayed by default, wrap it in some HTML and style it the way you want.

Programming / Writing Quick Look (QuickLook) Plug-in (plugin) Snow Leopard

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.