在Applescript命令中使用双引号执行Shell脚本回显

在Applescript命令中使用双引号执行Shell脚本回显

问题描述:

我正在尝试使用applescript运行命令行过程.Applescript的简化版本如下所示:

I'm trying to use applescript to run a command line process. A simplified version of the Applescript looks like this

do shell script "echo bwfmetaedit --INAM=\"name\" --IART=\"artist\" --ICRD=\"date\" /desktop/filepath.wav"

预期结果为

bwfmetaedit --INAM="name" --IART="artist" --ICRD="date" /desktop/filepath.wav

如果只想在Terminal中运行该命令,则会得到正确的输出.但是用applescript我得到以下结果.请注意在值周围缺少双引号.

If I were to just to run that command in Terminal, I get the correct output. However with applescript I get the following result. Note the missing double quotes around the values.

"bwfmetaedit --INAM=name --IART=artist --ICRD=date /desktop/filepath.wav"

我在这里想念什么?我需要在值两边加上双引号,否则命令将无法正常运行.

What am I missing here? I need the double quotes around the values or else the command wont run properly.

谢谢,摩根

尝试:

do shell script "echo bwfmetaedit --INAM=\\\"name\\\" --IART=\\\"artist\\\" --ICRD=\\\"date\\\" /desktop/filepath.wav"