P.S.: The reason your other script failed is because it created a loop
by having Quicksilver run the qs command line tool. The shell script
never exits because qs is waiting for a response from Quicksilver, and
Quicksilver never responds because it is busy waiting for the shell
script to complete.

On Sep 17, 5:29 am, Chris Cairns <[email protected]> wrote:
> this script works:
> try
>         tell me to activate
>         set thequery to display dialog "Enter the search query:" default
> answer "" with title "Spotlight Search"
>         set thequery to quoted form of text returned of thequery
>         -------------------------------------------------------------------
>         --display dialog thequery
>         set ifolder to (path to documents folder from user domain)
>         set ifolder to ifolder & "QSspotlight.txt" as text
>         set qifolder to quoted form of (POSIX path of ifolder)
>         -------------------------------------------------------------------
>         set thecmd to do shell script "mdfind " & thequery
>         set thecmd to quoted form of thecmd
>         do shell script "echo " & thecmd & " > " & qifolder
> do shell script "qs " & qifolder
>
> on error e
>         tell me to activate
>         display dialog e
> end try
>
> but this script fails:
>
> using terms from application "Quicksilver"
>         on process text thequery
>                 try
>                         set thequery to quoted form of thequery
>                         
> -------------------------------------------------------------------
>                         --display dialog thequery
>                         set ifolder to (path to documents folder from user 
> domain)
>                         set ifolder to ifolder & "QSspotlight.txt" as text
>                         set qifolder to quoted form of (POSIX path of ifolder)
>                         
> -------------------------------------------------------------------
>                         set thecmd to do shell script "mdfind " & thequery
>                         set thecmd to quoted form of thecmd
>                         say 1
>                         do shell script "echo " & thecmd & " > " & qifolder
>                         say 2
>                         do shell script "qs " & qifolder
>                         say 3
>                         on error e
>                         tell me to activate
>                         display dialog e
>                 end try
>         end process text
> end using terms from
>
> this part fails: do shell script "qs " & qifolder
> process "qs" in Activity monitor has to be quit to exit out of the
> script when it fails.

Reply via email to