Skip to content

Instantly share code, notes, and snippets.

@chongkim
Created February 27, 2015 15:51
Show Gist options
  • Save chongkim/8fb72d3ac9b142bc9976 to your computer and use it in GitHub Desktop.
Save chongkim/8fb72d3ac9b142bc9976 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