以下是 applescript :
do script ("aria2c -i /Users/mac/Downloads/aria2c\ \(1\).down") in currentTab
shell 中的预期结果是这样的:
~$ aria2c -i /Users/mac/Downloads/aria2c\ \(1\).down
但它不起作用......
答案 0 :(得分:0)
在AppleScript中,必须使用第二个反斜杠转义反斜杠:
do script ("aria2c -i /Users/mac/Downloads/aria2c\\ \\(1\\).down") in currentTab
更聪明的方法是quoted form of
,它会神奇地添加所有必要的反斜杠/引号字符
do script "aria2c -i " & quoted form of "/Users/mac/Downloads/aria2c (1).down" in currentTab