# Functions
> An assorted collection of useful OS X specific Bash-style functions. Part of [Awesome OS X Command Line](https://github.com/herrbischoff/awesome-osx-command-line).
## Table of Contents
- [Finder](#finder)
## Finder
### 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';
}
```
## License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.