简体   繁体   English

命令行中的Mac键盘

[英]Mac keyboard from the command line

I'm writing a bash script, and am attempting to open a separate terminal window to run commands in. I was able to open a new terminal window with open -a Terminal . 我正在编写bash脚本,并试图打开一个单独的终端窗口来运行命令。我能够使用open -a Terminal .打开一个新的终端窗口open -a Terminal . , but is it possible to switch between windows from bash? ,但是可以从bash在Windows之间切换吗?

You can run AppleScript scripts using command osascript. 您可以使用命令osascript运行AppleScript脚本。

Script for activating Terminal window: 用于激活“终端”窗口的脚本:

tell application "Terminal" to activate

Or opening new Terminal window: 或打开新的终端窗口:

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

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM