set thetext to the clipboard
do shell script "echo " & thetext
Dont try to make sense of the script. Its a part of another script. Just note that I want the shell to process the clipboard for some reasons.
As I understand, there is some quoting (single and double quotes) issue which does not allow the shell to process the clipboard properly if the clipboard contains special characters like “&” or spaces or empty lines.
How to fix it?
I read this article: http://tr.im/iYby
I know about osascript command and the “here” command(if applescript has more than one line) to write applescript code in bash but I dont think I will be able to first create a variable in applescript (“thetext” in the above example), and then process it with shell script (i.e. fix the quoting issue) so that shell script can use it.
(Also, i am not planning to call a bash file from applescript :))
the problem may be with quicksilver but it is regarding the " » " character. So what would be a workaround? (Somehow replace them with " > ").
Also, would it be possible to know which other characters are likely to have issues?
Thanks for the info, Jacques. The script is such a nice way to test things.
Is there no workaround?
The only thing i could think of was to replace the commonly used Extended ASCII characters with similar looking Standard ASCII characters using applescript text delimiters before passing the clipboard to shell… For example replace,
" » " character with " >> ").