PrafulD
PrafulD

Reputation: 568

Add double quotes (") to apple script for do shell script

I have an AppleScript

do shell script "echo hello \" Mr. X\" "

I should get the output hello "Mr. X" But, I get output hello Mr. X

I am using OS 10.10.5 Yosemite

How can I add double quotes to Mr. X using above script

Upvotes: 0

Views: 933

Answers (1)

vadian
vadian

Reputation: 285069

The most reliable syntax is using quoted form of:

do shell script "echo " & quoted form of "hello \"Mr. X\""

or use single quotes to escape the whole argument:

do shell script "echo 'hello \"Mr. X\"'"

Upvotes: 2

Related Questions