It would help to know the example text you use when it works and fails. I suspect the text has a newline or space in it and the resulting shell script has parsing issues. You want to escape the newlines or quote the whole text *in the script*. (or you might try a here script). I'll leave you to experiment. :)

Howard

On Apr 16, 2009, at 8:56 AM, Chris Cairns wrote:

set thetext to the clipboard
do shell script "echo " & thetext & "| qs -"

set thetext to the clipboard
do shell script "echo " & thetext & "| qs "

These scripts do not work reliably. Sometimes they work and at other times quicksilver's first pane opens with the clipping icon but no text in it.

Please dont suggest me alternatives ( i dont have Clipboard plugin installed because I cannot adjust to its behavior and secondly, for some reasons, i want this to work).

Even when i set a delay of 5 seconds between the two lines of code and try to use only a couple of lines of plain text, it fails.

However, once in while i get this error:

AppleScript Error
sh: -c: line 0: unexpected EOF while looking for matching `''
sh: -c: line 1: syntax error: unexpected end of file

I also think that the problem is with Quicksilver or shell but not applescript because it applescript's result pane, i can see the clipboard contents.

Reply via email to