Skip to content

Instantly share code, notes, and snippets.

@paranoidjk
Created March 7, 2016 13:42
Show Gist options
  • Select an option

  • Save paranoidjk/8e3296848487377d8a5e to your computer and use it in GitHub Desktop.

Select an option

Save paranoidjk/8e3296848487377d8a5e to your computer and use it in GitHub Desktop.
open currnt iterm2 path in Finder
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