Skip to content

Instantly share code, notes, and snippets.

@michaldarda
Forked from chongkim/iterm
Created July 28, 2016 12:25
Show Gist options
  • Save michaldarda/5d9354e586919b71698c77ee7a86fc8b to your computer and use it in GitHub Desktop.
Save michaldarda/5d9354e586919b71698c77ee7a86fc8b to your computer and use it in GitHub Desktop.
script to send commands to iTerm and go back to MacVim
#!/usr/bin/osascript
on run argv
tell application "iTerm"
if (count of terminals) = 0 then
set _terminal to (make new terminal)
else
set _terminal to current terminal
end if
activate
tell _terminal
tell the last session
set AppleScript's text item delimiters to " "
write text "" & argv
set AppleScript's text item delimiters to ""
end tell
end tell
end tell
delay 0.02
tell application "MacVim"
activate
end tell
end run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment