【问题标题】:Mac keyboard from the command line命令行中的 Mac 键盘
【发布时间】:2015-07-14 15:36:07
【问题描述】:

我正在编写一个 bash 脚本,并试图打开一个单独的终端窗口来运行命令。我能够打开一个新的终端窗口 open -a Terminal .,但是否可以从 bash 在窗口之间切换?

【问题讨论】:

标签: macos bash shell


【解决方案1】:

您可以使用命令 osascript 运行 AppleScript 脚本。

终端窗口激活脚本:

tell application "Terminal" to activate

或打开新的终端窗口:

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

在这里找到 - https://superuser.com/questions/195633/applescript-to-open-a-new-terminal-window-in-current-space

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-07-22
    • 1970-01-01
    • 1970-01-01
    • 2021-07-17
    • 2017-07-07
    • 2021-06-24
    • 2015-04-22
    相关资源
    最近更新 更多