Quick Look with Quicksilver - MacRumors Forums
Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Nov 28, 2007, 01:03 AM   #1
turkeypants
macrumors newbie
 
Join Date: Nov 2007
Quick Look with Quicksilver

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
Code:
#!/bin/bash
qlmanage -p "$@" >& /dev/null &
Applescript
Code:
on open of theFile
	set thePath to POSIX path of theFile
	do shell script "~/bin/ql " & thePath
end open
turkeypants is offline   0 Reply With Quote
Old Nov 28, 2007, 10:36 PM   #2
lancestraz
macrumors 6502a
 
lancestraz's Avatar
 
Join Date: Nov 2005
Location: RI
Sorry, but where is the QuickSilver actions folder?
lancestraz is offline   0 Reply With Quote
Old Nov 29, 2007, 11:06 AM   #3
turkeypants
Thread Starter
macrumors newbie
 
Join Date: Nov 2007
Location of Actions Folder

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?
turkeypants is offline   0 Reply With Quote
Old Nov 29, 2007, 11:34 AM   #4
lancestraz
macrumors 6502a
 
lancestraz's Avatar
 
Join Date: Nov 2005
Location: RI
Ah, there it is. Anyway, this works for me...

Code:
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...

Code:
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
lancestraz is offline   0 Reply With Quote
Old Nov 29, 2007, 12:17 PM   #5
turkeypants
Thread Starter
macrumors newbie
 
Join Date: Nov 2007
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.
turkeypants is offline   0 Reply With Quote
Old Nov 29, 2007, 02:04 PM   #6
lancestraz
macrumors 6502a
 
lancestraz's Avatar
 
Join Date: Nov 2005
Location: RI
How about...
Code:
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
lancestraz is offline   0 Reply With Quote
Old Nov 29, 2007, 08:14 PM   #7
turkeypants
Thread Starter
macrumors newbie
 
Join Date: Nov 2007
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.
Attached Files
File Type: zip QuickLook.scpt.zip (6.6 KB, 719 views)
turkeypants is offline   0 Reply With Quote
Old Nov 29, 2007, 08:19 PM   #8
xUKHCx
Administrator emeritus
 
xUKHCx's Avatar
 
Join Date: Jan 2006
Location: The Kop
Is there anyway so you an close it without having to click on the X, i.e. keyboard shortcuts.
xUKHCx is offline   0 Reply With Quote
Old Dec 23, 2007, 10:17 PM   #9
ddcrandall
macrumors newbie
 
Join Date: Apr 2006
Only works with certain things?

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.
ddcrandall is offline   0 Reply With Quote
Old Dec 25, 2007, 12:07 PM   #10
antiraum
macrumors newbie
 
Join Date: Dec 2007
The first line should be changed to
Code:
set thePath to quoted form of POSIX path of theFile
so that it works for files with spaces in the path.
antiraum is offline   1 Reply With Quote
Old Jan 4, 2008, 03:54 PM   #11
.adam
macrumors regular
 
Join Date: Nov 2007
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?
.adam is offline   0 Reply With Quote
Old Jan 5, 2008, 09:42 AM   #12
lancestraz
macrumors 6502a
 
lancestraz's Avatar
 
Join Date: Nov 2005
Location: RI
Quote:
Originally Posted by .adam View Post
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.
lancestraz is offline   0 Reply With Quote
Old Feb 5, 2010, 07:15 PM   #13
ziriguidum
macrumors newbie
 
Join Date: Jan 2010
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!
ziriguidum is offline   0 Reply With Quote
Old Aug 30, 2012, 05:09 AM   #14
SaileshR
macrumors newbie
 
Join Date: Oct 2011
Brilliant!

Quote:
Originally Posted by antiraum View Post
The first line should be changed to
Code:
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!
SaileshR is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Anyone want a Quicksilver? Jake0604 PowerPC Macs 13 Feb 18, 2014 08:45 AM
iPhone: Quick Reminder/Quick Note tweak? InsideBoxer Jailbreaks and iOS Hacks 3 Jan 29, 2014 04:22 PM
Help with G4 QuickSilver 128keaton PowerPC Macs 30 Nov 15, 2013 06:56 PM
iOS 7 Concept: Quick Gestures, Fullscreen App Switching, and Quick Settings Cam1 iOS 7 14 May 28, 2013 10:33 AM
G4 Quicksilver/Sawtooth? Pandalorian PowerPC Macs 8 Apr 2, 2013 09:55 AM

Forum Jump

All times are GMT -5. The time now is 06:37 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC