Created
March 7, 2016 13:42
-
-
Save paranoidjk/8e3296848487377d8a5e to your computer and use it in GitHub Desktop.
open currnt iterm2 path in Finder
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
| on alfred_script(q) | |
| 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 "Terminal")) then | |
| do shell script "open -a Terminal " & pathList | |
| else | |
| tell application "Terminal" | |
| activate | |
| tell application "System Events" to tell process "Terminal.app" to keystroke "t" using command down | |
| do script ("cd " & pathList) in first window | |
| end tell | |
| end if | |
| end tell | |
| end alfred_script |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment