AppleScript在终端中打开新标签不再适用于Mountain Lion?

时间:2012-08-29 16:47:34

标签: applescript osx-mountain-lion

我以前在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

1 个答案:

答案 0 :(得分:3)

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

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