AppleScript 在终端中打开新标签不再在 Mountain Lion 中工作?

Luk*_*uke 4 applescript osx-mountain-lion

我曾经在 Lion 中运行以下代码来打开终端,更新一个项目,然后打开一个新选项卡,然后再次运行以更新第二个、第三个和第四个。由于 Mountain 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
Run Code Online (Sandbox Code Playgroud)

Luk*_*uke 6

事实证明,出于某种原因,我需要告诉终端在每次通话之间激活。狮子从来没有让我这样做。

tell application "Terminal" to activate

tell application "Terminal"

    delay 0.25

    do script "cd Projects/firstone/trunk && svn up" in front window
end tell

tell application "Terminal" to activate

tell application "System Events" to tell process "Terminal" to keystroke "t" using command down

tell application "Terminal"

    delay 0.25

    do script "cd Projects/secondone/trunk && svn up" in front window

end tell
Run Code Online (Sandbox Code Playgroud)