Quick-Look-text-selection

Anyone who has used a Mac for more than a minuscule amount of time has more than likely come across Quick Look, the pop-up window that is invoked with a press of the space bar when a file or folder is highlighted on the desktop or in Finder. Quick Look’s usefulness becomes evident when file names aren’t descriptive enough by allowing users to view the contents of many different types of files without having to open them in a full-fledged application like Pages for documents or Preview for images.

By default Quick Look can only display a static view of a file that only grants users a peek at the contents without any real function. Imagine, however, being able to copy a document’s text without having to open it in TextEdit or Pages. This is incredibly useful in a variety of situations, from dealing with templates to Word documents to code snippets, where having multiple applications and documents opened shouldn’t be necessary for copying from one location and pasting to another. The good news is that this functionality is completely possible and perfectly easy to enable.

Turn on text selection in Quick Look on Mac

Pre-requisite: In order for all of this to work, you must first disable System Integrity Protection on your Mac. Also know as “rootless,” this features adds a level of security to your machine. Learn how to disable System Integrity Protection.

Step 1: Open Terminal. This can be done by searching for “Terminal” in Spotlight or by locating it in the Applications folder. Your version of Terminal may look different from mine, and that’s ok.

Terminal

Step 2: Enter the following command into Terminal and press enter:

defaults write com.apple.finder QLEnableTextSelection -bool true

Terminal-command

Step 3: You should be able to highlight the contents of text documents at this point, but if not, typing killall Finder into Terminal and pressing enter or rebooting your Mac should fix the issue.

Quick-Look-highlight

Reverting back

If you don’t like the results or want to switch back to the original settings for whatever reason, doing so is as simple as following the above steps but changing the latter part of the command from “true” to “false”. This simply means substituting the following command for the one in step 2:

defaults write com.apple.finder QLEnableTextSelection -bool false

And that’s all! Now, instead of having to open a file to get at its contents, you can simply press the space bar and select and copy text from Quick Look, making working in OS X a little bit more convenient.

  • Jacob S

    Mine is on by default it seems. Without making any change I was able to select and copy text from terminal windows.

    I don’t remember I ever making any changes to text selection at all.

    Anyways nice post with helpful information!

    • The post was about being able to highlight text in Quick Look, not Terminal. I’ve updated it with another image to clarify the meaning.

  • Bith

    Great, I missed this before.
    I don’t know why isn’t this on by default.

  • michaelmoves

    This is my favorite command, and I agree it should be on by default. How do we get it to work when we use QuickLook in Full Screen mode? Or in apps like Mail?

  • kokeropie

    Great post…. I didn’t even know how to access Quick Look.
    Thanks for the tips 🙂

  • Uhm, so you’re basically opening the document in QuickLook instead of say TextEdit or Pages? Not sure how you’re saving time in this case. Mind elaborating?

    • Jonathan Talbot

      QuickLook opens a lot faster and u just have to press the spacebar to access it 😉

      • Interesting, thanks for the info. Just to confirm, pressing “Enter” on the file opens it in Pages, right?

  • Casey

    Great! I love when Apple has these simple tweaks available in their shipped OS…wish there were more for advanced users.

  • Kev

    This stopped working in El Capitan.. Any ideas if there’s a workaround or alternative?

    • Cory Mathews

      I am looking for a solution too.

    • Ugo

      +1

    • Me too. Any news from anyone?

    • VRH

      Same here…

    • Ugo

      idem.
      still no way…

    • The bool value was changed in El Capitan. The new value is YES rather than TRUE.

      defaults write com.apple.finder QLEnableTextSelection -bool YES

      • Kev

        Still not working. Did you even try this yourself?

    • John McClane

      +1

    • Actually it still works but you need to disable rootless first. See the “pre-requisite” in the post.

  • sadyhr

    Hm.
    I hope/guess, that’s perfectly safe – and actually a good idea – to enable rootless after isuing the defaults write command to enable text selection in Quick Look.

    I’m still using 10.9, so I don’t actually have a way to test myself.

  • Elf55

    Sadly – in OSX 10.11 (El Capitan) this hack no longer works. You can set the QLEnableTextSelection variable to “1” or “True” or “Yes”, but quick look no longer allows text cut.