oct*_*ian 4 macos applescript iterm2
我编写了一个非常基本的苹果脚本,该脚本打开iTerm
并转到文件:
tell application "iTerm"\n activate\n do script "cd ~" in tab 1\nend tell\n
Run Code Online (Sandbox Code Playgroud)\n\n但是,如果我尝试运行它,我会得到Syntax Error
:
Expected end of line, etc. but found \xe2\x80\x9cscript\xe2\x80\x9d.\n
Run Code Online (Sandbox Code Playgroud)\n\n知道为什么会这样吗?
\n\n该脚本中是否存在一些不正确的语法?
\n是的,事实证明语法不正确。
这有效:
tell application "iTerm"
create window with default profile
tell current session of current window
write text "cd ~"
end tell
end tell
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
1942 次 |
最近记录: |