Skip to content

Instantly share code, notes, and snippets.

@basilbeltran
Created October 27, 2018 04:37
Show Gist options
  • Save basilbeltran/1d310f0064e08f1809d49ade15c0740b to your computer and use it in GitHub Desktop.
Save basilbeltran/1d310f0064e08f1809d49ade15c0740b to your computer and use it in GitHub Desktop.
run iterm with start commands
#!/bin/bash
read -r -d '' script <<'EOF'
on run argv
tell application "iTerm"
activate
set myterm to (make new terminal)
tell myterm
launch session "Default"
tell the last session
repeat with arg in argv
say arg
write text arg
end repeat
end tell
end tell
end tell
end run
EOF
echo "$script" | osascript ``-'' $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment