Applescript Expected “"” but found unknown token This is my code. I wanted to run an app (Game Capture HD) twice at the same time. But I get this Syntax Error: Expected “&quot;” but found unknown token.
Appreciate if anyone can fix it
on run
    do shell script &quot;open -n /Applications/Game\ Capture\ HD.app&quot;
    tell application &quot;Game\ Capture\ HD&quot; to activate
end run

on open theFiles
    repeat with theFile in theFiles
        do shell script &quot;open -na /Applications/Game\ Capture\ HD.app &quot; &amp; quote &amp; (POSIX path of theFile) &amp; quote
    end repeat
    tell application &quot;Game\ Capture\ HD&quot; to activate
end open
The spaces mess things up. Try:
do shell script &quot;open -n &quot; &amp; quoted form of &quot;/Applications/Game Capture HD.app&quot;

Essentially, 'quoted form' is for passing text to 'do shell script'. Both the Script Editor and the shell will be interpreting the text and 'quoted form' helps manage that.
For more information, refer to the Applescript Language Guide &gt; Class Reference &gt; Text &gt; Properties of text objects
Additional info can be found in Technical Note TN2065: do shell script in AppleScript