Skip to content

Instantly share code, notes, and snippets.

@emaysyuk
Last active December 21, 2019 09:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emaysyuk/5f7a6f3e81e8611bc3261975eb0d8b88 to your computer and use it in GitHub Desktop.
Save emaysyuk/5f7a6f3e81e8611bc3261975eb0d8b88 to your computer and use it in GitHub Desktop.
Automator script that opens iTerm in current folder (script can be binded to macOS Finder toolbar)
on run {input, parameters}
tell application "Finder"
set dir to quoted form of (POSIX path of (folder of the front window as alias))
if application "iTerm" is running then
tell application "iTerm"
tell current window
create tab with default profile
end tell
tell current session of current window
write text "cd " & dir & "&& clear"
end tell
activate
end tell
else
tell application "iTerm"
tell current session of current window
write text "cd " & dir & "&& clear"
end tell
activate
end tell
end if
end tell
return input
end run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment