Skip to content

Instantly share code, notes, and snippets.

@mrpollo
Created March 14, 2012 16:52
Show Gist options
  • Select an option

  • Save mrpollo/2037827 to your computer and use it in GitHub Desktop.

Select an option

Save mrpollo/2037827 to your computer and use it in GitHub Desktop.
Finder functions for bash
# Get the path to the last Finder window with focus
function ff {
osascript -e 'tell application "Finder"'\
-e "if (${1-1} <= (count Finder windows)) then"\
-e "get POSIX path of (target of window ${1-1} as alias)"\
-e 'else' -e 'get POSIX path of (desktop as alias)'\
-e 'end if' -e 'end tell';
}
# Get into the result of `ff`
function cdff { cd "`ff $@`"; };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment