Skip to content

Instantly share code, notes, and snippets.

@command-tab
Created May 1, 2013 13:07
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 command-tab/5495190 to your computer and use it in GitHub Desktop.
Save command-tab/5495190 to your computer and use it in GitHub Desktop.
# Navigate to the frontmost Finder window
function navigate_finder
{
osascript -e 'tell application "Finder" to if window 1 exists then if target of window 1 as string is not ":" then get POSIX path of (target of window 1 as alias)'
}
alias f="cd \"\$(navigate_finder)\""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment