Created
June 22, 2012 16:52
-
-
Save Nek/2973949 to your computer and use it in GitHub Desktop.
Useful fish shell functions for OS X Lion.
This file contains 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
function pfdir; | |
echo "tell application \"Finder\" | |
return POSIX path of (target of window 1 as alias) | |
end tell" | osascript ^/dev/null; | |
end; |
This file contains 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
function pfsel; | |
echo "set output to \"\" | |
tell application \"Finder\" to set the_selection to selection | |
set item_count to count the_selection | |
repeat with item_index from 1 to count the_selection | |
if item_index is less than item_count then set the_delimiter to \"\n\" | |
if item_index is item_count then set the_delimiter to \"\" | |
set output to output & ((item item_index of the_selection as alias)'s POSIX path) & the_delimiter | |
end repeat" | osascript ^/dev/null; | |
end; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment