Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save chauncey-garrett/9959883 to your computer and use it in GitHub Desktop.
Save chauncey-garrett/9959883 to your computer and use it in GitHub Desktop.
tell application "System Events"
tell process "Finder"
if window 1 exists then
tell application "Finder"
set thePath to get quoted form of POSIX path of (target of front Finder window as text)
return "cd " & thePath & return
end tell
else
display alert "Finder doesn't have a window open." as warning giving up after 2
end if
end tell
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment