简体   繁体   中英

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 . , but is it possible to switch between windows from bash?

You can run AppleScript scripts using command osascript.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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