mac-finder — Open Finder at a Directory
Opens Finder and navigates to a specified directory path. Supports ~ expansion and validates that the path exists before opening.
Usage
# Open a specific directory in Finder
python3 mac_finder.py "~/Downloads"
python3 mac_finder.py "/Users/benson/Desktop"
python3 mac_finder.py "/Applications"
Common directories
| Name | Path |
|---|---|
| Desktop | ~/Desktop |
| Downloads | ~/Downloads |
| Documents | ~/Documents |
| Pictures | ~/Pictures |
| Music | ~/Music |
| Movies | ~/Movies |
| Applications | /Applications |
How it works
- Expands
~to the user's home directory viaos.path.expanduser - Validates that the path exists and is a directory
- Opens the directory with
openand activates Finder viaosascript