0

这曾经在 Mountain Lion OS X 之前工作:

tell application "Terminal"
    activate
    do script "cd /"
end tell

现在,打开了新的 bash 窗口,但没有执行任何操作,无论命令行脚本是什么

它在我尝试过的几个系统上都坏了,但这是一个普遍的问题吗?有解决方法吗?

4

2 回答 2

1

检查 Terminal.app 的 Preferences,有很多新窗口的选项以及启动时要打开的 Shell 等等——</p>

于 2013-03-28T02:47:45.290 回答
1

按预期工作。

您的环境或 .bashrc 最近有什么变化吗?

bash$ cat t.applescript 
tell application "Terminal"
    activate
    do script "cd /"
end tell

 

bash$ osascript t.applescript
tab 1 of window id 9766

  新终端窗口打开,“cd /”在缓冲区中可见,shell 位于 /。

bash$ uname -smr
Darwin 12.2.0 x86_64

编辑:也在 10.8.3 上验证

bash$ uname -smr
Darwin 12.3.0 x86_64
于 2013-03-28T02:04:52.453 回答