这是我在快捷命令插件里执行AppleScript,打开iterm2执行shell脚本,并隐藏item2窗口的脚本。
if application "iTerm" is running then
tell application "iTerm"
set newWindow to (create window with default profile)
tell current session of newWindow
write text "adb connect 192.168.123.73:5555"
write text "scrcpy"
end tell
end tell
else
activate application "iTerm"
end if
delay 0.5
tell application "System Events" to tell process "iTerm2" to set visible to false