Created
August 10, 2018 17:19
-
-
Save nathancahill/2e54f76c76da257c4cdd3fbafccbc3fd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "Finder" | |
set this_folder to (the target of the front window) as alias | |
set thePath to quoted form of POSIX path of this_folder | |
set theCmd to "cd " & thePath & ";clear;" | |
end tell | |
tell application "iTerm" | |
activate | |
set aWindow to current window | |
if aWindow is equal to missing value then | |
set aWindow to (create window with default profile) | |
else | |
tell aWindow | |
set t to (create tab with default profile) | |
end tell | |
end if | |
tell current session of aWindow | |
write text theCmd | |
end tell | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment