在Applescript命令中使用双引号执行Shell脚本回显 [英] Using double quotes in Applescript command Do Shell Script Echo
本文介绍了在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"
这篇关于在Applescript命令中使用双引号执行Shell脚本回显的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文