mirror of
https://github.com/oh-my-fish/oh-my-fish
synced 2024-11-07 15:20:22 +00:00
13 lines
606 B
Fish
13 lines
606 B
Fish
# Return the path of the frontmost Finder window
|
|
|
|
function pfs -d "Return the path of the frontmost Finder window"
|
|
osascript 2>/dev/null -e '
|
|
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'
|
|
end |