Enable text selection in QuickLook

QuickLookIconXApple’s QuickLook feature in OS X is a convenient option to have when browsing for files on your Mac’s hard drive. By simply pressing the space bar with an item highlighted, you can view information about it, or see its contents. If you use this to preview the contents of text files, then you might find some added convenience from the hidden option of being able to select and copy text from within the QuickLook window.

To do this, you simply need to enable the “QLEnableTextSelection” property for the QuickLook service, which can be done by opening the Terminal and running the following command (copy and paste it, for convenience):

defaults write com.apple.finder QLEnableTextSelection -bool TRUE
Selecting text in QuickLook windows

With the command run and the Finder relaunched, you can now select text in QuickLook windows, and then copy it for use elsewhere (click image for larger view).

When this is done, you can hold the Option key and then right-click the Finder icon in the Dock, and choose the option to relaunch the Finder, or you can go to the Terminal and run the following command:

killall Finder

Now you can peruse your file system, and then select a document and press the Space bar to preview it, followed by simply clicking and dragging your mouse in the preview window to select the desired text you see.

Keep in mind that if you want to move the QuickLook window, then you will now need to drag it by its title bar, instead of being able to do so from anywhere in the preview window. This might be a small frustration for some, but the added benefit of being able to quickly select a section of text to then copy elsewhere in the system, might more than make up for it.

To undo this command, simply run the above command again but change “TRUE” to “FALSE,” or run the following version of it to delete this custom entry entirely, again followed by relaunching the Finder:

defaults delete com.apple.finder QLEnableTextSelection

4 thoughts on “Enable text selection in QuickLook

  1. Lynne

    ever since I updated to Mavericks, my Quicklook has not worked properly – it works for the first photo I open (I use it a lot to preview my photos to see if they’re worth editing) then if I arrow down to the next file with the QL window open, I can usually see that file too – but if I want to go back up to a previous file, I get a blank white box. I’ve read about this happening to other people as well but never read a solution. Does anyone have any suggestions? thanks

  2. Hello

    Hey Lynne, it’s precisely this “Enable text selection in QuickLook” that causes your white screen problem with images. Turn it off and the white screen problem goes away. Bummer, I know.

  3. Lynne

    hmmm…well I tried what you suggested and now Quicklook doesn’t work at all!!! when I highlight a photo, I get a window that says “an error occurred with the preview of this document” and sometimes (but only sometimes) I get a teeny tiny preview of the photo in the same window!!! I tried to turn the enabling back on to see if that makes a difference but nope!!

  4. Lynne

    me again – I was able to get my QL back to its previous non-functional state by using the command to enable text selection again…..so at least I can now see the large previews as long as I don’t want to up-arrow to go back through my photos!! I’m hoping that installing Yosemite might fix this issue!!


Leave a Reply to Hello Cancel reply