How do I tell applescript to “do shell script” if the script has speech marks in it? Applescript ends the shell script as soon as it runs into the next speech mark, so I don’t get my script run.
for example
do shell script "echo "walrus""
errors because it ends prematurely.
This is probably very simple, but doesn’t seem particularly obvious to me.
" is called a double-quote. There are at least three ways:
do shell script "echo 'walrus'" -- use single quotes
do shell script "echo \"walrus\"" -- escape the quotes (and any spaces) with backslashes
do shell script "echo " & quoted form of "walrus" -- let applescript do it