Advertisement
Guest User

Untitled

a guest
Jul 13th, 2015
377
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. on run {input, parameters}
  2.     set filename to POSIX path of input
  3.     set fn2 to quoted form of filename
  4.     set cmd to "cd `dirname " & fn2 & "` && vim " & fn2
  5.     tell application "iTerm"
  6.         activate
  7.         delay 0.3
  8.         tell application "System Events" to keystroke "b" using control down
  9.         tell application "System Events" to keystroke "c"
  10.         delay 0.5
  11.         tell the current window
  12.             tell the current session
  13.                 write text cmd
  14.             end tell
  15.         end tell
  16.     end tell
  17. end run
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement