Created
January 24, 2022 20:01
-
-
Save defmech/16eb77f1bca590b5e418735c4f23c6d9 to your computer and use it in GitHub Desktop.
AppleScript version of Go2Shell
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 pathList to (quoted form of POSIX path of (folder of the front window as alias)) | |
end tell | |
tell application "System Events" | |
if not (exists (processes where name is "iTerm2")) then | |
do shell script "open -a iTerm " & pathList | |
else | |
tell application "iTerm" | |
set newWindow to (create window with default profile) | |
tell current session of newWindow | |
write text "cd " & pathList & " && clear" | |
end tell | |
end tell | |
end if | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment