Add function to show the path to the frontmost finder window

This commit is contained in:
Joe Block 2015-11-07 07:18:44 -08:00
parent b5e354625b
commit f6e88269c6

View File

@ -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/