在mac用脚本打开应用,无提示关闭终端窗口命令
osascript -e "tell application \"System Events\" to keystroke \"w\" using command down"
这模拟了 CMD + w 按键。 如果您希望终端完全退出,您可以使用: osascript -e "tell application \"System Events\" to keystroke \"q\" using command down"
这不会产生任何错误,并使终端干净利落。