I am trying to write a script that could run several commands on several tabs in the terminal. I found a lot of information about this, but it does not work the way I want. So I probably need AppleScript.
β’ This code launches the command in a new window:
tell app "Terminal"
do script "echo hello"
end tell
β’ And this will open a new tab
tell application "Terminal"
activate
tell application "System Events"
keystroke "t" using {command down}
end tell
end tell
But I did not understand how to "mix" them. Any idea?
source
share