在 Applescript 命令中使用双引号 Do Shell Script Echo [英] Using double quotes in Applescript command Do Shell Script Echo
本文介绍了在 Applescript 命令中使用双引号 Do Shell Script Echo的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用 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
如果我只是在终端中运行该命令,我会得到正确的输出.但是使用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"
这篇关于在 Applescript 命令中使用双引号 Do Shell Script Echo的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文