Guest User

Untitled

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