我是Applescript的菜鸟并且经常搜索并找到了很多有用的信息,但是我似乎无法破解最后一块工作:
tell application "iTerm"
activate
tell application "System Events"
keystroke "t" using {command down}
end tell
write text "echo 'hello'" in selected tab
end tell
我在这里做错了什么?非常感谢任何帮助。
答案 0 :(得分:0)
创建新标签后,current session
会设置新标签页,您可以write text
。
tell application "iTerm2"
tell current window
create tab with default profile
tell current session
write text "echo StackOverflow"
end tell
end tell
end tell