Bleh, and for the second method, you should use \"$foo\" instead of just $foo.
On May 29, 2:24 pm, "Jon Stovell (a.k.a. Sesquipedalian)" <[email protected]> wrote: > Also, the first line of the first version should be changed to > > printf "$foo" | pbcopy > > If the quotation marks are not placed around $foo, printf will only > send the first word contained in $foo to the clipboard. > > On May 29, 2:16 pm, "Jon Stovell (a.k.a. Sesquipedalian)" > > > > <[email protected]> wrote: > > Ah. Well, since your script's output is just plain text anyway, you > > could also use this method instead: > > > osascript -e "tell application \"System Events\" to keystroke $foo" > > > That will cause the script to simulate typing the text for you, rather > > than copying it to the clipboard and then pasting by simulating a ⌘V. > > This alternate method bypasses the clipboard, but is a little more > > fragile, in that if you press any keys while the script is typing the > > text for you, the characters you press will be inserted in the midst > > of the characters the script is typing. > > > On May 29, 2:02 pm, jrh <[email protected]> wrote: > > > > Well, > > > > Thank you Jon! that of course did the trick. Many thanks!! The only > > > problem I see is that I miss the contents of the clipboard every time > > > the script is run but I can live with it. :-) > > > > Regards, > > > > On May 29, 6:02 pm, "Jon Stovell (a.k.a. Sesquipedalian)" > > > > <[email protected]> wrote: > > > > Bleh, stupid automatic formatting. Make sure to remove the line break > > > > after \"v\" in the command I posted above > > > > > On May 29, 11:56 am, "Jon Stovell (a.k.a. Sesquipedalian)" > > > > > <[email protected]> wrote: > > > > > Instead of returning the results of the script to Quicksilver, have > > > > > the script paste the results. Adding this to the end of your script > > > > > should do the job (replacing $foo with whatever is appropriate in your > > > > > script, of course): > > > > > > printf $foo | pbcopy > > > > > osascript -e "tell application \"System Events\" to keystroke \"v\" > > > > > using command down" > > > > > > Note that we are using printf instead of echo because echo > > > > > automatically inserts a newline at the end of the text it outputs, > > > > > which is not what we want in this case. > > > > > > On May 29, 8:52 am, jrh <[email protected]> wrote: > > > > > > > Hi all, > > > > > > > Sorry if this is just too easy but I have been trying to do it with > > > > > > no > > > > > > luck... > > > > > > > I am trying to concatenate several commands in one trigger. What I > > > > > > want to do is get the selected text of the current window and send > > > > > > it > > > > > > a shell script as input. Then paste the output of the script into > > > > > > the > > > > > > current window. I can do it in the command window in several > > > > > > commands > > > > > > by getting the selected text and pass it to a script with leaves the > > > > > > output in the command windows and I can paste it as text. > > > > > > > However, is it possible to do it in one trigger?? > > > > > > > Regards,
