Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.5: Add Quick Look support for certain file formats System 10.5
I have a lot of files that contains data in plain text format with different extensions -- things like .cfg, .dat and .tex. However, those files are not recognized by the Quick Look viewer. It is possible to make these other files visible with the default Quick Look viewers by simply adding a UTI (Uniform Type Identifiers) file reference to an application's Info.plist file.

For example, TeXShop is an application that writes Latex files in plain-text with the .tex extension. If you want to see these .tex files with Quick Look, conrol-click on TexShop.app in the Finder and chose Show Package Contents from the pop-up menu. Navigate into Contents, then open Info.plist with TextEdit and add the public.plain-text string to the UTTypeConformsTo key as follows:

First look for the UTExportedTypeDeclarations section in the original file:

...
  <key>UTExportedTypeDeclarations</key>
  <array>
    <dict>
      <key>UTTypeConformsTo</key>
      <array>
        <string>public.text</string>
      </array>
      <key>UTTypeDescription</key>
      <string>TeX text file</string>
      <key>UTTypeIdentifier</key>
      <string>org.tug.tex</string>
      <key>UTTypeTagSpecification</key>
      <dict>
        <key>com.apple.ostype</key>
        <string>TEXT</string>
        <key>public.filename-extension</key>
        <array>
          <string>tex</string>
          <string>latex</string>
          <string>ltx</string>
          <string>texi</string>
          <string>ctx</string>
        </array>
      </dict>
    </dict>
  </array>


Now add the public.plain-text string to the UTTypeConformsTo key:
...
  <key>UTExportedTypeDeclarations</key>
  <array>
    <dict>
      <key>UTTypeConformsTo</key>
      <array>
        <string>public.text</string>
        <string>public.plain-text</string>
      </array>
      <key>UTTypeDescription</key>
      <string>TeX text file</string>
      <key>UTTypeIdentifier</key>
      <string>org.tug.tex</string>
      etc...
To make the changes take effect, the UTI reference must be exported again. One way to do this is to try moving the application to another folder and then putting it back in its original location and opening it. However, it may be that a logout is required. Now you should see .tex, .latex, .itx, .texi and .ctx as plain-text in Quick Look. This trick can be extended to other applications by adding the public.plain-text or public.movie (for files that QuickTime can open) string to the UTTypeConformsTo key.

If your file doesn't have a UTExportedTypeDeclarations, you can add it to the Info.plist inside an application or bundle by copying the above keys (from the complete first section of code, not the abbreviated second bit) and changing public.filename-extension strings with the extensions of your application. You may need to change org.tug.tex to any other name, as in org.perian.mkv (for matroska video files, for example). This works fine with Perian and mkv files, so you can preview then in Quick Look.
    •    
  • Currently 3.27 / 5
  You rated: 5 / 5 (11 votes cast)
 
[81,835 views]  

10.5: Add Quick Look support for certain file formats | 34 comments | Create New Account
Click here to return to the '10.5: Add Quick Look support for certain file formats' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.5: Add Quick Look support for certain file formats
Authored by: NHN on Nov 08, '07 07:52:12AM

Nice tip, I have just reinstalled TexShop and this will help.
Is there a way to make Microsofts .chm files viewable?
I have a bunch of computer related book that I would love to be able to glance through via Quicklook



[ Reply to This | # ]
10.5: Add Quick Look support for certain file formats
Authored by: moondark on Nov 19, '07 12:28:15PM

You will need a plugin to do that because chm files are not plain text... Lets wait for someone doing that for us :D



[ Reply to This | # ]
10.5: Add Quick Look support for certain file formats
Authored by: funkymonkey on Nov 08, '07 09:10:01AM

I'd love a way to gain quick look support for Illustrator CS3 files.
Surely it shouldn't be too difficult considering the file is largely PDF.



[ Reply to This | # ]
10.5: Add Quick Look support for certain file formats
Authored by: moondark on Nov 24, '07 04:42:53PM

Weird, Quickllooks generate previews for coverflow, but not for quicklook itself... I tryed adding UTI export as images, but didn't work either.



[ Reply to This | # ]
10.5: Add Quick Look support for certain file formats
Authored by: te.es on Nov 08, '07 09:24:22AM

Instead of moving the app around and logging out etc., open the terminal and touch it.

touch /Applications/TeXShop.app

for example.



[ Reply to This | # ]
10.5: Add Quick Look support for certain file formats
Authored by: Andy LoPresto on Nov 08, '07 09:57:44AM
In case anyone else would like ASP code to display in Quick Look (PHP does by default but not ASP), here is the code I used (Coda required). In /Applications/Coda.app/Contents/Info.plist: <key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.text</string>
<string>public.plain-text</string>
</array>
<key>UTTypeDescription</key>
<string>ASP code file</string>
<key>UTTypeIdentifier</key>
<string>com.panic.coda</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>com.apple.ostype</key>
<string>TEXT</string>
<key>public.filename-extension</key>
<array>
<string>asp</string>
<string>aspx</string>
</array>
</dict>
</dict>
</array>
And then in terminal: $ touch/Applications/Coda.app as the previous poster noted.

[ Reply to This | # ]
10.5: Add Quick Look support for certain file formats
Authored by: spheare on Nov 08, '07 11:33:56AM

Sweet! I was looking for a way to do this, thanks!
I noticed however that, when doing this with FLV files in QuickTime's info.plist, Quicklook is working, but Finder doesn't generate previews for the file. Is there a way to accomplish this?



[ Reply to This | # ]
10.5: Add Quick Look support for certain file formats
Authored by: moondark on Nov 08, '07 11:49:46AM

Yes... I'm having problem with this, that is because some videos take longer to load the begining(like mkv and maybe flv) so quicklook abort the thumbnail generation. :( I think that this can only be solved by creating a new quicklook plugin to handle those files...



[ Reply to This | # ]
10.5: Add Quick Look support for certain file formats
Authored by: CraigK on Nov 08, '07 05:17:05PM

Could do us a favor and post what you added to where to get Quick Look to work with flv files?

With the Perian codecs they play just fine in QT Player, but as you know - they don't show using Quick Look.

Thanks!



[ Reply to This | # ]
10.5: Add Quick Look support for certain file formats
Authored by: moondark on Nov 08, '07 11:27:57PM
Try adding something like that to the end of a plist of any application, like VLC, the application itself is not important. I'm not sure, but maybe it is possible to add the definition to Info.plist inside perian.component. something like that:

	<key>UTExportedTypeDeclarations</key>
	<array>
		<dict>
			<key>UTTypeConformsTo</key>
			<array>
				<string>public.movie</string>
			</array>
			<key>UTTypeDescription</key>
			<string>FLV Video File</string>
			<key>UTTypeIconName</key>
			<string>generic</string>
			<key>UTTypeIdentifier</key>
			<string>org.perian.flv</string>
			<key>UTTypeReferenceURL</key>
			<string>http://www.macromedia.com/</string>
			<key>UTTypeTagSpecification</key>
			<dict>
				<key>public.filename-extension</key>
				<array>
					<string>flv</string>
				</array>
			</dict>
		</dict>
	</array>


[ Reply to This | # ]
10.5: Add Quick Look support for certain file formats
Authored by: etoffin on Nov 10, '07 10:13:53AM
I've just found it :
[link:http://homepage.mac.com/xdd/software/flv/]
Works great !

[ Reply to This | # ]
10.5: Add Quick Look support for certain file formats
Authored by: moondark on Nov 12, '07 02:53:04PM

Hey this plugin is great...

You can have thumbnails in mkv if you add the mkv extension to UTI reference in Info.plist of this plugin! Works flawless.




[ Reply to This | # ]
10.5: Add Quick Look support for certain file formats
Authored by: charleski on Nov 08, '07 06:46:59PM

This is a star! Definitely deserves to be put in the shortlist for the prize.



[ Reply to This | # ]
10.5: Add Quick Look support for certain file formats
Authored by: Axlin on Nov 08, '07 10:44:28PM

How would you do this for OmniOutliner? Adding <string>public.plain-text</string> and then touching it doesn't seem to be doing anything.



[ Reply to This | # ]
.rhtml in Quick Look with TextMate
Authored by: reenhanced on Nov 09, '07 08:45:26AM
I've added Quick Look support for .rhtml files in Textmate by adding the following to the end of Info.plist, immediately before

</dict>
</plist>
Add the following:

  <key>UTExportedTypeDeclarations</key>
  <array>
    <dict>
      <key>UTTypeConformsTo</key>
      <array>
        <string>public.text</string>
        <string>public.plain-text</string>
      </array>
      <key>UTTypeDescription</key>
      <string>HTML with Embedded Ruby</string>
      <key>UTTypeIdentifier</key>
      <string>com.macromates.textmate</string>
      <key>UTTypeTagSpecification</key>
      <dict>
        <key>com.apple.ostype</key>
        <string>TEXT</string>
        <key>public.filename-extension</key>
        <array>
          <string>rhtml</string>
        </array>
      </dict>
    </dict>
  </array>
Then do,
 
$ touch /Application/TextMate.app
And you'll have Quick Look support for all your .rhtml files.

Enjoy!

Nick Hance
Reenhanced, LLC
www.reenhanced.com

[ Reply to This | # ]
10.5: Add Quick Look support for certain file formats
Authored by: etoffin on Nov 10, '07 09:20:04AM

What's the changes to do with Quicktime .plist to get mkv preview and Quicklook in the Finder ?



[ Reply to This | # ]
10.5: Add Quick Look support for certain file formats
Authored by: moondark on Nov 11, '07 08:36:28AM
for matroska video suport, select a application or bundle, show package, blabla in Info.plist: before the text:

</dict>
</plist>
add the key:

<key>UTExportedTypeDeclarations</key>
	<array>
		<dict>
			<key>UTTypeConformsTo</key>
			<array>
				<string>public.movie</string>
			</array>
			<key>UTTypeDescription</key>
			<string>Matroska Video File</string>
			<key>UTTypeIconName</key>
			<string>generic</string>
			<key>UTTypeIdentifier</key>
			<string>com.apple.quicktime.mkv</string>
			<key>UTTypeReferenceURL</key>
			<string>http://www.matroska.org/</string>
			<key>UTTypeTagSpecification</key>
			<dict>
				<key>public.filename-extension</key>
				<array>
					<string>mkv</string>
				</array>
			</dict>
		</dict>
	</array>
try that.!

[ Reply to This | # ]
WORKS LIKE CHARM
Authored by: patte on Nov 12, '07 09:47:29AM

Great. Thank You.



[ Reply to This | # ]
10.5: Add Quick Look support for certain file formats
Authored by: archie79muc on Nov 23, '07 01:10:31AM

Hi there,

is there a quicklook plugin for AppleWorks .cwt files?



[ Reply to This | # ]
10.5: Add Quick Look support for certain file formats
Authored by: moondark on Nov 24, '07 04:40:28PM

unfortunately not... and because apple discontinued appleworks, i think that we will never see something like that... :(



[ Reply to This | # ]
10.5: Add Quick Look support for certain file formats
Authored by: zaphodb on Nov 27, '07 01:45:51PM

I can not figure out from these hints how to add certain plain text file extensions
to be shown with the same quick look preview as other text edit files.
Let's say some logger generates text files with a .rglog extension, how can I make these files work properly with quick look?

Thanks!



[ Reply to This | # ]
10.5: Add Quick Look support for certain file formats
Authored by: jocamero on Jan 27, '08 07:40:31PM
I'm having the same challenges... I'd like to add .nfo files to Quick Look. I've attempted editing the .plist file for TextEdit which I have set to open the .nfo (plain txt file). Here's what I've added at the end of the file just before these last two lines:
</dict>
</plist>


  <key>UTExportedTypeDeclarations</key>
  <array>
    <dict>
      <key>UTTypeConformsTo</key>
      <array>
        <string>public.text</string>
        <string>public.plain-text</string>
      </array>
      <key>UTTypeDescription</key>
      <string>nfo text file</string>
      <key>UTTypeIdentifier</key>
      <string>com.apple.ostype</string>
      <key>UTTypeTagSpecification</key>
      <dict>
        <key>com.apple.ostype</key>
        <string>TEXT</string>
        <key>public.filename-extension</key>
        <array>
          <string>nfo</string>
        </array>
      </dict>
    </dict>
  </array>

Can anyone fill me in on what I'm missing??

[ Reply to This | # ]
adding support for .nfo files
Authored by: jocamero on Jan 27, '08 09:22:20PM
Well I never could figure out how to edit the TextEdit .plist file so I downloaded TeXShop and successfully edited its .plist file. I basically added the .nfo string to the original poster's suggested edit. And now I can quick look any .nfo file and presumable any extension that is formated as a plain text file. I don't use the TeXShop application for anything other than this purpose so is there anyone that can come up with a more elegant solution? Possibly editing the TextEdit .plist file?


	<key>UTExportedTypeDeclarations</key>
	<array>
		<dict>
			<key>UTTypeConformsTo</key>
			<array>
				<string>public.text</string>
				<string>public.plain-text</string>
			</array>
			<key>UTTypeDescription</key>
			<string>TeX text file</string>
			<key>UTTypeIdentifier</key>
			<string>org.tug.tex</string>
			<key>UTTypeTagSpecification</key>
			<dict>
				<key>com.apple.ostype</key>
				<string>TEXT</string>
				<key>public.filename-extension</key>
				<array>
					<string>tex</string>
					<string>latex</string>
					<string>ltx</string>
					<string>texi</string>
					<string>ctx</string>
					<string>nfo</string>
				</array>
			</dict>
		</dict>
	</array>

[code/]


[ Reply to This | # ]
10.5: Add Quick Look support for certain file formats
Authored by: herbs on Nov 28, '07 09:07:52AM

Howdy,

To get this to work on my system I had to run

sudo qlmanage -r

in Terminal after making the suggested change in TeXShop's info.plist file. This resets the Quick Look Server and forces it to rebuild the database. (Apropos is your friend! :-))

Good Luck,
Herb Schulz


---
Good Luck,
Herb Schulz



[ Reply to This | # ]
10.5: Add Quick Look support for certain file formats
Authored by: gedalin on Dec 01, '07 02:34:42AM

TeX hint fails to work for me.



[ Reply to This | # ]
10.5: Add Quick Look support for certain file formats
Authored by: macfan2007 on Nov 29, '07 03:06:25PM
Has anybody gotten this to work with AlphaX?
That's the editor I use for my LaTeX files. It's nice.
http://alphatcl.sourceforge.net/wiki/pmwiki.php/Software/AlphaX

I tried making a similar change in the AlphaX Info.plist file, but it didn't seem to work. My .tex files still don't show their contents in QuickLook. Any tips for AlphaX greatly appreciated!



[ Reply to This | # ]
10.5: Add Quick Look support for certain file formats
Authored by: macfan2007 on Nov 30, '07 05:34:33PM

Solution to my previous question: it turns out that making the change to TeXshop's Info.plist file that is described at the top of this hint produces the desired effect for .tex files made by AlphaX, too.

I guess the key thing is that one you have at least one .tex file recognized by QuickLook, then after that they all are, regardless of which app created them? Anyway, it works! :-)



[ Reply to This | # ]
10.5: Add Quick Look support for certain file formats
Authored by: macfan2007 on Dec 11, '07 10:50:02AM
This QuickLook plugin is even better, as it color-codes the LaTeX file,
and displays it in a bigger font than the horribly tiny default one.

http://code.google.com/p/qlcolorcode/

It's actually for source code generally, but it works for LaTeX too.
It's quite decent for Matlab .m files, also. Nice!

[ Reply to This | # ]
10.5: Add Quick Look support for certain file formats
Authored by: davidbk1 on Apr 18, '08 07:15:38PM

Has anyone figured out why this doesn't work for .m or .sh files? This would be really helpful!



[ Reply to This | # ]
10.5: Add Quick Look support for certain file formats
Authored by: domantasj on Apr 23, '08 12:32:46PM
This seems to work with TextEdit and .nfo files: Right before the end of the file:

<key>UTExportedTypeDeclarations</key>
	  <array>
	    <dict>
	      <key>UTTypeConformsTo</key>
	      <array>
	        <string>public.text</string>
	        <string>public.plain-text</string>
	      </array>
	      <key>UTTypeDescription</key>
	      <string>NFO information file</string>
	      <key>UTTypeIdentifier</key>
	      <string>com.macromates.textmate</string>
	      <key>UTTypeTagSpecification</key>
	      <dict>
	        <key>com.apple.ostype</key>
	        <string>TEXT</string>
	        <key>public.filename-extension</key>
	        <array>
	          <string>nfo</string>
	        </array>
	      </dict>
	    </dict>
	  </array>
And then use Terminal to do: touch /Applications/TextEdit.app/

[ Reply to This | # ]
10.5: Add Quick Look support for certain file formats
Authored by: ianeiloart on May 19, '08 03:36:34AM

: domantasj's comment isn't quite right. The text doesn't go right at the end, it has to be nested inside the <dict> structure. So, you can paste the text above the last two lines:

--- paste here ---
</dict>
</plist>

Works for BBEdit, too. You might need to change the value for UTTypeIdentifier, though.

---
Ian Eiloart



[ Reply to This | # ]
10.5: Add Quick Look support for certain file formats
Authored by: domantasj on Nov 08, '09 12:54:52PM
thanks, ianeiloart

also, in 10.6 (Snow Leopard) the last step should be:
sudo touch /Applications/TextEdit.app/ 


[ Reply to This | # ]
10.5: Add Quick Look support for certain file formats
Authored by: xhinter on Jun 27, '09 01:07:24PM

@moondark
how did you modify the Info.plist of the plugin flv.qlgenerator for creating mkv thumbnails?
I tried with the key posted in this thread to no avail.



[ Reply to This | # ]
10.5: Add Quick Look support for certain file formats
Authored by: tohvanah on May 15, '10 05:41:08PM
Why doesn't this work? I'm running 10.6.3

I'm attempting to add support for QuickView of DivX files with an extension of ".divx.part"

I added the following to Quicktime Player.app's Info.plist :


<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.movie</string>
</array>
<key>UTTypeDescription</key>
<string>DivX Video File</string>
<key>UTTypeIconName</key>
<string>generic</string>
<key>UTTypeIdentifier</key>
<string>com.divx.divx</string>
<key>UTTypeReferenceURL</key>
<string>http://www.divx.com/</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>part</string>
</array>
</dict>
</dict>
</array>


[ Reply to This | # ]