OSX, Copy text directly from Quick Look

Copy text from Quick Look

Quick Look is one of OS X's best features. Hit the Spacebar when you select a file, and you'll see a preview of that file without having to open up an app. It's great, but you can't select any text when you're in the preview.
You can use the following terminal command in the OS X terminal app to enable text selection in Quick Look:

defaults write com.apple.finder QLEnableTextSelection -bool true

killall Finder

Once the text function is enabled, you can select text as shown above in blue and then use command-C to copy it to the clipboard.
If you want to turn off the text selection and copy option, just change the value of "true" to "false" in the terminal command as shown below:

defaults write com.apple.finder QLEnableTextSelection -bool false

killall Finder

When testing it seems to work for pdf xcl and normal text documents but not for doc and docx...