Created
August 20, 2020 18:03
-
-
Save jpfreire/5c8db00567a39e7355cb0c930424c455 to your computer and use it in GitHub Desktop.
AppleScript to open new tab in current dir
This file contains hidden or 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
-- Export the AppleScript as an aplication then enable it in System Preferences > Security & Privacy > Privacy > Accessibility | |
tell application "iTerm" to activate | |
tell application "System Events" to keystroke "pwd | pbcopy" | |
tell application "System Events" to key code 52 | |
tell application "System Events" to keystroke "t" using command down | |
delay 2 | |
tell application "System Events" to keystroke "cd \"`pbpaste`\" " | |
tell application "System Events" to key code 52 | |
-- then you can use it in Spotlight (command + space bar) | |
-- same funcionality can be achieved using iterm profiles preferences: | |
-- Iterm > Preferences > Profiles > General > Working Directory > Reuse previous session's directory |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment