thanks Jon for the help.
but i could not get it to work.
If i do everything as you told me too, QS hangs and i have to relaunch
it.
If i bring up the script in the first pane, i get "Process text" as
default action and then i type text in the next pane and hit return,
QS hangs.
If i run it from Script Editor, nothing happens at all.
Also, i want to you know that i want to set up a trigger (a trigger
which presents me a text box for typing in search query and shows the
result in QS so that i can work with the results). From what i
understand, even if your applescript worked, it would be same as
typing text in the first pane and
using action "Spotlight in Command".
On 30-Oct-08, at 10:28 AM, Jon Stovell (a.k.a. Sesquipedalian) wrote:
Oh, I forgot to give instructions and explanation. Paste the text from
"using terms from" through to "end findReplace" into Script Editor,
and save it as something like "Find All Spotlight Matches.scpt" in ~/
Library/Application Support/Quicksilver/Actions. To use it, enter text
in the first pane and select this action in the second pane.
Quicksilver will pop back up with all the files that matched that
Spotlight search string.
On Oct 30, 12:53 am, "Jon Stovell (a.k.a. Sesquipedalian)"
<[EMAIL PROTECTED]> wrote:
I fiddled with this a bit. It seems the qs command chokes on package
files that are piped to it. Oddly, those same package files are
handled perfectly when given as arguments instead of being piped to
the command. So I whipped up an Applescript to do the job
using terms from application "Quicksilver"
on process text inputString
set foundfiles to do shell script "mdfind " &
inputString
--The following is all one line
set foundfiles to "\"" & my findReplace(return,
"\"" & space & "\"",
foundfiles) & "\""
--
do shell script "qs " & foundfiles
end process text
end using terms from
on findReplace(findText, replaceText, sourceText)
set ASTID to AppleScript's text item delimiters
set AppleScript's text item delimiters to findText
set sourceText to text items of sourceText
set AppleScript's text item delimiters to replaceText
set sourceText to sourceText as text
set AppleScript's text item delimiters to ASTID
return sourceText
end findReplace
On Oct 29, 11:43 pm, Chris Cairns <[EMAIL PROTECTED]> wrote:
i did not post the error that i got earlier because i thought you
would be able to reproduce it and also the error did no seem to make
sense.
this is the error when i run the script from Applescript or when i
run
mdfind r | qs directly from terminal
2008-10-30 09:09:46.059 qs[618:10b] *** Terminating app due to
uncaught exception 'NSInvalidArgumentException', reason: '[NOTE:
this
exception originated in the server.]
*** -[NSCFDictionary setObject:forKey:]: attempt to insert nil value
(key: NSStringPboardType)'
2008-10-30 09:09:46.081 qs[618:10b] Stack: (
2418475627,
2528878747,
2418474385,
2457741414,
2457739273,
2418498250,
2418498354,
11601,
10958,
10741
)
sh: line 1: 617 Done mdfind r
618 Trace/BPT trap | qs