2

So I know some questions have already been asked about this like Is there a QuickLook preview for plain-text files with unknown extensions? and QuickLook for files with no extension or an unknown extension, but those questions are regarding fixes as oppose to Apple's reasoning behind not supporting QuickLook for some file types.


I have many text files that I use with TextEdit, some in .rtf format and some in .txt format. I also have many .docx files for school. I'm pretty sure Microsoft created the plugin for QuickLook to work with .docx files. .rtf files are also supported by QuickLook.

Text files seem like the simplest file type, because unlike .rtf files, they lack elaborate text ornamentation and (sometimes) complex formatting.

Why aren't .txt files supported by QuickLook? Are they more elaborate than they seem, or is there something I'm missing?


UPDATE: Here's an illustration of what I'm talking about: enter image description here

5
  • possible duplicate of QuickLook for files with no extension or an unknown extension
    – stuffe
    Commented Aug 6, 2012 at 22:58
  • I selected a .txt file in the Finder, pressed space bar, and got a preview. Seems to work fine for me, out-of-the-box, as long as the Finder can determine its type. So I'm not sure I understand the question -- ?
    – Ken
    Commented Aug 7, 2012 at 0:12
  • Apple created the QuickLook plugin for dock files. It’s an open format, not owned by MS.
    – duci9y
    Commented Aug 7, 2012 at 8:50
  • 1
    Quick Look should support normal plain text files by default. Have you tried disabling the qlgenerator bundles in ~/Library/QuickLook/ and /Library/QuickLook/ by for example moving them somewhere else? Or qlmanage -r, which resets Quick Look Server and all Quick Look client's generator cache?
    – Lri
    Commented Aug 7, 2012 at 12:34
  • 1
    @stuffe This question isn't a duplicate. The OP didn't make it as clear, but the question isn't asking for a fix. Rather it is asking for a reason why they aren't supported.
    – daviesgeek
    Commented Aug 14, 2012 at 21:27

3 Answers 3

2

Normally, text files are supported by QuickLook. If you have one that isn't, chances are that there is something "odd" about the file, at least from the Finder's point of view.

Try opening the file in TextEdit and then choose "Format" and then "Make Rich Text" as shown here:

http://images.luo.ma/TextEdit-Format-Make-Rich-Text.jpg

  • Type a space (or modify the document in some other minor way).

  • go back to the "Format" menu and choose "Make Plain Text" again.

  • Save the file.

  • Check to see if QuickLook is able to show the file.

3
  • I tried that and it didn't work...
    – pasawaya
    Commented Aug 7, 2012 at 22:13
  • Bummer. If you create a new plain text document and then copy/paste from the old to the new, and then save it, does the new file work in QuickLook? I presume that you've tried rebooting and qlmanage -r
    – TJ Luoma
    Commented Aug 9, 2012 at 18:56
  • So I've run qlmanage -r in Terminal and rebooted. I then tried to make a new plain text file and copied in the old content, and QuickLook still doesn't work...
    – pasawaya
    Commented Aug 9, 2012 at 22:49
2

I had the same problem, and Lri's comment of using qlmanage -r fixed it right up for me. It also caused .sh and .c files to work with quicklook as well.

I would have commented in that space but StackExchange doesn't think I'm cool enough to do that

2

I had the same problem and I solved it by noticing that a wrong (corrupted or so) qlgenerator was used to generate the quicklook preview of plain-text files. To do this, you can type, in a terminal,

qlmanage -m plugins

and search for the public.plain-textstring (e.g. using grep), so you should get something similar to

qlmanage -m plugins | grep public.plain-text
   public.plain-text -> /Library/QuickLook/QLMultiMarkdown.qlgenerator (1.2.1 - loaded)

Here it means that in my case the QLMultiMarkdown is responsible for generating the corrupted quicklook for plain-text extension (.txt). There must be a way to force quicklook to point to another qlgenerator for public.plain-text. However, I didn't even try because I don't need QLMultiMarkdown. Instead, I simply moved QLMultiMarkdown.qlgenerator to a backup subfolder (/Library/QuickLook/bak/) and reloaded qlmanage with

qlmanage -r

You can now try to preview any .txt files with quicklook by hitting the spacebar. I hope it works for you!

Just for your own info, to verify which qlgenerator is in use now, re-type

qlmanage -m plugins | grep public.plain-text

which outputs

public.plain-text -> /Library/QuickLook/QLColorCode.qlgenerator (2.0.1 - loaded)

in my case. (Note that QLColorCode is a very handy extension for syntax highlighting of source code but rather useless for simple text files. However it works so I won't complain about it.)

1
  • Excellent! Your answer helped me troubleshooting. In my case QLcolorcode was corrupted after an upgrade to Mojave. I had to rm -r ~/Library/QuickLook/QLColorCode.qlgenerator, brew cask reinstall qlcolorcode, qlmanage -r, qlmanage -r cache
    – n1000
    Commented Mar 19, 2019 at 12:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .