diff --git a/README.md b/README.md index e6320da..98c54da 100644 --- a/README.md +++ b/README.md @@ -388,6 +388,19 @@ textutil -convert html file.ext sudo chmod -RN /path/to/folder ``` +#### Get Path of Frontmost Finder Window +```bash +function finder_path { + 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'; +} +``` + #### Hide Folder in Finder ```bash chflags hidden /path/to/folder/