Not really, you send every command seperated by a return or ; to the interpreter. The inpterpreter receives a string and start parsing it. While parsing it you can indicate with quotes which parts belongs to eachother. Normally values on the command line are separated by characters in the input field separator, a variable named IFS. By default it contains a newline, tab and a space.
--the command line interpreter sends hello and world as two seperate values to the process
set theFormat to "'arg1:%s" & return & "arg2:%s'"
do shell script "printf " & theFormat & " hello world"
I’ve used in the example above printf because echo isn’t able to show us the parameters. Now if we want hello world as a single argument to an application we need to escape it:
–the double backslash is for AppleScript needed, when it is send to the command line it’s a single backslash.
set theFormat to "'arg1:%s" & return & "arg2:%s'"
do shell script "printf " & theFormat & " hello\\ world"
The example above is also named a single character quotation. You told the interpreter that the next character is a space and not a delimiter/separator. There is also a strong quotation for the shell where hello world can be notated in many different ways.
set theFormat to "'arg1:%s" & return & "arg2:%s'"
do shell script "printf " & theFormat & " 'hello world'"
do shell script "printf " & theFormat & " \"hello world\""
do shell script "printf " & theFormat & " hello' 'world"
do shell script "printf " & theFormat & " hello\" \"world"
do shell script "printf " & theFormat & " 'hello'' 'world"
do shell script "printf " & theFormat & " \"hello\"\" \"world"
do shell script "printf " & theFormat & " 'hello'' ''world'"
do shell script "printf " & theFormat & " \"hello\"\" \"\"world\""
do shell script "printf " & theFormat & " hello' ''world'"
do shell script "printf " & theFormat & " hello\" \"\"world\""
--you can even mix single and double quotes in a string
do shell script "printf " & theFormat & " hello\" \"'world'"
do shell script "printf " & theFormat & " hello' '\"world\""
--I think this would be enough examples :D
Maybe a little to many examples but, as you can see, strong quotations does not indicate the beginning of a value nor does it indicate the end of a value. It turns on and off if the following characters are quoted or not. Then there is the quote in string
do shell script "echo x\\'x" --"x'x"
do shell script "echo \"x'x\"" --"x'x"
do shell script "echo 'x'\\''x'" --"x'x";same as quoted form of
do shell script "echo 'x'\"'\"'x'" --"x'x"
do shell script "echo 'x'\\'\"x\"" --"x'x"; the most odd one
But after all this and knowing how quotations works on the command line, quoted form of has never let me down. It has been working perfectly even when there are quoted form of quoted forms involved (like MySQL on the command line). Quoted form of is not only a solid command but also faster than inventing the wheel again with AppleScript code.