But there's one limitation of QuickLook that's been driving me crazy. As soon as you switch away from Finder (to another application), which is to say, as soon as Finder loses focus, the QuickLook window disappears. What I wanted was truly persistent QuickLook. There are a couple of hits on Google if you enter "persistent QuickLook" - but they only tell you to use Cmd+Y.... And that suffers from the same limitation as using the space bar to invoke QuickLook — at least, as near as I can tell.
Practically, this means that you can't view the Word (or Excel or Powerpoint) document while you type text into another program. Which is irritating, and, as far as I was concerned, rendered QuickLook very nearly useless — or at least, pretty much broken. I wanted QuickLook on the left, and TextEdit (or OmniOutliner or Pages, etc.) on the right, so I could transcribe the one to the other. I found myself frequently PDF'ing the source file so I could actually keep it up for reference while I worked.
Fortunately, there is a way to make the QuickLook window not disappear on you. You can invoke QuickLook from the command line, using
qlmanage
(man qlmanage
for details). Irritatingly (though perhaps arguably correct behavior), qlmanage
doesn't exit until the QuickLook window it summons has been closed — but we can get around that with a little dancing and a call to nohup
. Here's how I do it:nohup qlmanage -p "/path/to/file" > /dev/null 2>&1 &
This will bring up a QuickLook preview of the specified file, return you your prompt immediately, and suppress all of the output typically generated by
nohup
(both the "Appending output to nohup.out" message and the actual output that is typically appended).Of course, you don't really want to have to open Terminal and type in that string every time you want a persistent QuickLook of a file. Neither do I. Automator comes to the rescue, and gives you the rest of the solution.
In Automator, make a new Workflow for which "Get Selected Finder Items" is the first step and "Run Shell Script" the second. In "Run Shell Script", change "Pass Input" from "as stdin" to "as arguments." Then, delete the template text Automator helpfully provides you with in the "Run Shell Script" box and replace it with:
nohup qlmanage -p "$@" > /dev/null 2>&1 &
Then select "Save As Plug-in..." from the File menu. Automator, again helpfully, offers to build you a Plug-in for Finder — which is exactly what you want. Name it something descriptive (I called mine "Persistent QuickLook" and click Save.
Now, open a Finder window, right-click on something, select "More..."->"Automator"->"Persistent QuickLook" (or whatever you named it), wait a couple of seconds, and — voilĂ ! you have a QuickLook preview of whatever you clicked that doesn't go away. That's a bit more work than merely hitting the space bar (and it takes a bit of time to open, which is a pity), but at least the QuickLook window won't disappear when Finder loses focus.
2 comments:
Excellent tip thank you. Seems Snow 10.6 requires this to be a service now but still works. Now I'm just trying to figure out how to make the persistent quick look window stay open but not on top of all other windows.
thanks for the interesting information
Post a Comment