Created
March 14, 2012 16:52
-
-
Save mrpollo/2037827 to your computer and use it in GitHub Desktop.
Finder functions for bash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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