mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2024-12-12 21:43:45 +08:00
15 lines
371 B
Fish
15 lines
371 B
Fish
|
# Return the path of the frontmost Finder window
|
||
|
|
||
|
function pfd
|
||
|
if count $argv >/dev/null
|
||
|
switch $argv[1]
|
||
|
case -d --description
|
||
|
echo "Return the path of the frontmost Finder window"
|
||
|
return 0
|
||
|
end
|
||
|
end
|
||
|
osascript 2>/dev/null -e '
|
||
|
tell application "Finder"
|
||
|
return POSIX path of (target of window 1 as alias)
|
||
|
end tell'
|
||
|
end
|