Advertisement
Guest User

Untitled

a guest
Jul 28th, 2016
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. on run {input, parameters}
  2. tell application "Finder"
  3. set dir_path to quoted form of (POSIX path of (folder of the front window as alias))
  4. end tell
  5. CD_to(dir_path)
  6. end run
  7.  
  8. on CD_to(theDir)
  9. tell application "iTerm"
  10. activate
  11. try
  12. set w to first window
  13. on error
  14. set w to (create window with default profile)
  15. end try
  16. tell w
  17. tell (create tab with default profile)
  18. launch session "Default Session"
  19. tell current session
  20. write text "cd " & theDir & ";clear;"
  21. end tell
  22. end tell
  23. end tell
  24. end tell
  25. end CD_to
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement