I am trying to create a service using Automator.
Inside a Run AppleScript action I have a variable that is a string in which each line is a word separated by linefeed. Like this:
à
às
a
ante
ao
aos
após
aquela
When I try to echo this to terminal by doing:
do shell script "echo " & (finalText as string)
I get this error:
The action “Run AppleScript” encountered an error: “sh: line 1: a: command not found
sh: line 2: à: command not found
sh: line 3: ante: command not found
...
sh: -c: line 30: syntax error near unexpected token `do'
sh: -c: line 30: `do'”
Any ideas?
do shell scriptcommand in a Run AppleScript action isn't going to do much of anything if all you are doing is echoing some strings of text, however, from the errors you are obviously doing more than that! Anyway, to get rid of the command not found type errors, use:do shell script "echo " & finalText's quoted form-- As to the syntax error near unexpected token `do' error, without seeing all of the code, it's impossible to troubleshoot.'s quoted formdid the trick. Please make this command an answer, so I can accept.