【发布时间】:2016-12-28 02:09:01
【问题描述】:
我对 AppleScript 还是很陌生。我需要一个打开 3 个 iTerm 选项卡并分别执行 3 个命令行程序的脚本。第一个程序终止,而后两个程序不确定地运行。
这是我所拥有的:
tell application "iTerm"
activate
set next to (make new terminal)
tell next
activate current session
launch session "Default Session"
tell the last session
set name to "vagrant-db"
write text "cd ~/Workspace/vagrant-db; vagrant up"
end tell
launch session "Default Session"
tell the last session
set name to "next/core"
write text "cd ~/Workspace/next"
write text "/usr/local/bin/sbt \"project core\" \"run\""
end tell
launch session "Default Session"
tell the last session
set name to "next/web"
write text "cd ~/Workspace/next"
write text "/usr/local/bin/sbt \"project web\" \"~re-start\""
end tell
end tell
end tell
问题是我需要等待第一个命令行操作结束(vagrant 启动),然后再发出第二个和第三个。有没有办法做到这一点?
【问题讨论】:
标签: applescript