Skip to content

Instantly share code, notes, and snippets.

@jrk
Created June 3, 2009 01:25
Show Gist options
  • Select an option

  • Save jrk/122722 to your computer and use it in GitHub Desktop.

Select an option

Save jrk/122722 to your computer and use it in GitHub Desktop.
Shell aliases for quickly acting on the frontmost Finder window.
# Define front_finder_window_path to return the POSIX path string to the frontmost Finder window
alias front_finder_window_path="osascript -e 'tell application \"Finder\" to get URL of target of front Finder window' | sed 's/file:\\/\\/localhost//g'"
# cd to the front Finder window path
alias cdf='cd `front_finder_window_path`'
# pushd to the front Finder window path
alias pushdf='pushd `front_finder_window_path`'
alias pushf=pushdf
alias pdf=pushdf
# Open the front Finder window path in TextMate
alias matef='mate `front_finder_window_path`'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment