Yep that is a limitation I have also encountered. I tried it in any
location I could think of and it seems dual mode scripts in file are
not possible.
As a workaround I have resorted to create two files with the same name
(seemingly... the "open handler" file just has an extra space at the
end of its filename).

I also tried various combinations of 'using terms from app
"Quicksilver"' wrappers and calling one handler from the other and
vice versa. It also does seem that getting "run handler" actions
noticed from the "Actions" subfolder can sometimes be tricky. I had
better results for those when I put them in "~/LIbrary/Scripts/
Quicksilver".

If you're interested there are some more insights I have written down
in a RTF file in one of my file uploads here at the group.

André


On 21 Sep., 13:54, Chris Cairns <[email protected]> wrote:
> actually, this single script should have replaced two scripts but for
> some reasons the scripts in actions folder have the default action
> "open" instead of "run". Infact, there is no action "run" for them
> (maybe because they are supposed to process text and files only).
>
> on open theFile
>    try
>        set theFile to theFile as text
>        --say 1
>        tell application "System Events"
>            if exists process "qlmanage" then
>                do shell script "killall qlmanage"
>            else
>                my processthis(theFile)
>            end if
>        end tell
>    on error e
>                    tell me to activate
>        display dialog e
>    end try
> end open
>
> on processthis(theFile)
>    set thePath to quoted form of (POSIX path of theFile)
>    --say 2
>    set thecmd to "qlmanage -p " & thePath
>    do shell script thecmd & "> /dev/null 2>&1 &"
>    --say 3
>    set closepath to "path to:this:script" as alias
>    --say 4
>    return closepath
> end processthis

Reply via email to