Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on run {input, parameters}
- tell application "Finder"
- set dir_path to quoted form of (POSIX path of (folder of the front window as alias))
- end tell
- CD_to(dir_path)
- end run
- on CD_to(theDir)
- tell application "iTerm"
- activate
- try
- set w to first window
- on error
- set w to (create window with default profile)
- end try
- tell w
- tell (create tab with default profile)
- launch session "Default Session"
- tell current session
- write text "cd " & theDir & ";clear;"
- end tell
- end tell
- end tell
- end tell
- end CD_to
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement