我曾经在 Lion 中运行以下代码来打开终端,更新项目,然后打开一个新选项卡,然后再次运行以更新第二个、第三个和第四个。自从山狮升级后,这不再有效。一半时间似乎在我的主目录中打开 Finder,另一半时间似乎打开 OSX 字体/文本对话框。我已经确认 Cmd+T 仍应打开一个新选项卡。知道为什么它坏了吗?
tell application "Terminal" to activate
tell application "Terminal"
do script "cd Projects/blahblah/trunk" in front window
do script "svn up" in front window
end tell
tell application "System Events" to tell process "Terminal" to keystroke "t" using command down