Skip to content

Instantly share code, notes, and snippets.

@LeoUfimtsev
Created July 18, 2019 15:24
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save LeoUfimtsev/82e7e827b6bfb1000f422a98f2008cc3 to your computer and use it in GitHub Desktop.
Save LeoUfimtsev/82e7e827b6bfb1000f422a98f2008cc3 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Write given argument into current iterm session. (useful if running commands from another application).
osascript - "$@" <<EOF
on run argv
tell application "iTerm2"
tell current session of current window
repeat with arg in argv
write text arg
end repeat
end tell
end tell
end run
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment