PDA

View Full Version : Quick Look with Quicksilver




turkeypants
Nov 28, 2007, 01:03 AM
I am trying to make a Quicksilver action that will take a file and show the quick look preview of it. So far I have (1) created a bash script, (2) created an applescript that calls the bash script, and (3) placed the applescript in the Actions folder for Quicksilver.

It works, but after the quick look pane is invoked Quicksilver remains the foremost application, in front of quick look. One can easily click on the quick look pane and bring it into focus, but is annoying. Any ideas on how to prevent this from happening?

Bash
#!/bin/bash
qlmanage -p "$@" >& /dev/null &

Applescript
on open of theFile
set thePath to POSIX path of theFile
do shell script "~/bin/ql " & thePath
end open



lancestraz
Nov 28, 2007, 10:36 PM
Sorry, but where is the QuickSilver actions folder?

turkeypants
Nov 29, 2007, 11:06 AM
The Quicksilver Actions folder is: ~/Library/Application Support/Quicksilver/Actions

If the folder doesn't exist, then create it. Once an action is added, restart Quicksilver for it to show up.

Any ideas on this window focus problem though?

lancestraz
Nov 29, 2007, 11:34 AM
Ah, there it is. Anyway, this works for me...

on open of theFile
set thePath to POSIX path of theFile
do shell script "qlmanage -p \"$@\" >& /dev/null " & thePath
end open

If for some reason that doesn't work try...

on open of theFile
set thePath to POSIX path of theFile
do shell script "qlmanage -p \"$@\" >& /dev/null " & thePath
tell application "Finder" to activate
end open

turkeypants
Nov 29, 2007, 12:17 PM
Thanks! Both of those options do work a lot better, not perfect but useable for now.

The first option: when you close the Quick Look pane, Quicksilver is active behind it.

Second option: when you close the Quick Look pane, Finder because active (obviously), but if you have some other application up before it is deactivated. Any way to bring the activity back to the window that was in focus before Quicksilver was called?

Thanks again.

lancestraz
Nov 29, 2007, 02:04 PM
How about...
on open of theFile
set thePath to POSIX path of theFile
do shell script "qlmanage -p \"$@\" >& /dev/null " & thePath
tell application "Quicksilver" to close window 1
end open

turkeypants
Nov 29, 2007, 08:14 PM
Works great! Thanks for your help.

For all those interested here is the script to download. Unzip. Place script in the ~/Library/Application Support/Quicksilver/Actions folder. Create the Actions folder if it doesn't already exist. Then, restart Quicksilver.

To use, call Quicksilver, select a file, tab, type "QuickLook" and hit enter. The pane is closed by clicking on the X.

xUKHCx
Nov 29, 2007, 08:19 PM
Is there anyway so you an close it without having to click on the X, i.e. keyboard shortcuts.

ddcrandall
Dec 23, 2007, 10:17 PM
After much effort, I got this to work, but it only seems to be capable of handling pictures. I've tried txt, rtf, doc, and pages files, and none of them work. I simply get a weird quicklook window with an off-center box that has a dotted line border.

Any ideas? I could post screenshots if needed.

antiraum
Dec 25, 2007, 12:07 PM
The first line should be changed to
set thePath to quoted form of POSIX path of theFile
so that it works for files with spaces in the path.

.adam
Jan 4, 2008, 03:54 PM
Hey,

I installed the attached script above to Quicksilver 'Actions' file however (like a user above has stated), the Quicklook window cannot be closed using spacebar like normal.

Any ideas as to a fix?

lancestraz
Jan 5, 2008, 09:42 AM
Hey,

I installed the attached script above to Quicksilver 'Actions' file however (like a user above has stated), the Quicklook window cannot be closed using spacebar like normal.

Any ideas as to a fix?
I have no idea how to make it do this.

ziriguidum
Feb 5, 2010, 07:15 PM
Can I disable the left and right-arrow native shortcuts in iTunes (which are by default assigned to play the previous and next song), and then assign it to some scripts i've made (in this case, to fast forward/ rewind 10 seconds of currently playing song)?

thanks!

SaileshR
Aug 30, 2012, 05:09 AM
The first line should be changed to
set thePath to quoted form of POSIX path of theFile
so that it works for files with spaces in the path.

This worked a treat - thanks!