mac,hazel,downloads,gems,productivity,hacks,organization,folders,growl,stacks,unarchiver,tech,os x,leopard,macbook,computer,computers,macs,apple,apples,tips,tutorial,article,blog
How I Manage My Downloads with Hazel
Like many of the productivity lifehackers I've encountered, I have a specified way of managing and sorting all files that are downloaded to my Downloads directory. I perfer an automated method that moves files into predetermined folders so that when I go to look for an item, I know exactly where to find it. I could just as easily examine each file in the Downloads directory and decide to open it immediately to extract, move or discard its contents. However, I make use of hard-drive space mapping applications, such as Disk Inventory X and Baseline, and I like to know which types of files are taking up the most space on my system. And so, Ladies and Gentlemen of the Midnight Society, it is my pleasure to present to you, The Case of the Auto Sorted Downloads Directory.
I use four apps/tools to make my process work.
Hazel (http://www.noodlesoft.com/hazel.php; $21.95)
The Unarchiver (http://wakaba.c3.cx/s/apps/unarchiver.html; Free)
Stacks (Built in to Leopard; Free)
Growl (http://www.growl.info; Free)
Additionally, since I will lay out of Hazel rule system for you, it's important that I detail the structure of my Downloads directory. While many other files go to other places, it's tedious to detail the entire directory structure of my Home folder. I'm pretty sure nobody wants to read it all.
I. Hazel
Hazel is one app that has been mentioned and reviewed by few bloggers and editors. When I first tried it, I found little use for it and vanquished it from my system. After reading a positive review on MacWorld, I decided to give it a second try. After tinkering with it for a few hours, I came up with some effective rules and discovered some powerful features within it that I had no idea existed. One of those features that particularly impressed me was the Growl notification options. After any action taken, you can add a custom Growl notification to appear, complete with variables from completed actions.
Hazel is somewhat of a scripting prefpane application that watches folders and performs actions. It's much like Folder Actions, but it can be disabled easily and run manually. It can watch your Trash and empty it when it reaches certain threshholds (mine is 1GB), discover deleted applications and trash their associated system files left behind, and even detect duplicates in folders and remove them for you. These features are just icing on the cake.

I have seventeen rules that are applied just for my Downloads directory (not including sub-directories). I also have thirteen other directories that are watched and sorted by Hazel. I will list out the rules for Downloads and the subdirectories within it.

A. Downloads
Rule Name: Packages
Condition Preference: All
Condition 1: Extension contains pkg
Do the Following:
1. Move file to folder Packages (~/Downloads/Installers/Packages)
2. Send Growl Notification with pattern: (file) has been moved to Packages.
Rule Name: WMV
Condition Preference: All
Condition 1: Extension is wmv
Do the Following:
1. Move file to folder: Movies (~/Movies)
2. Send Growl notification with pattern (file) has been moved to Movies.
Rule Name: Music Files
Condition Preference: All
Condition 1: Kind is Music
Do the Following:
1. Move file to Music (~/Music)
2. Send Growl notification with pattern (file) has been moved to Music.

Rule Name: Widgets
Condition Preference: All
Condition 1: Extension is wdgt
Do the Following:
1. Send Growl notification with pattern: New Dashboard widget has been detected. Starting installation of (file)
2. Open file with application: Default Application
Rule Name: iTunes Media
Condition Preference: Any
Condition 1: Extension is mp4
Condition 2: Extension is m4v
Condition 3: Extension is m4a
Do the Following:
1. Move file to folder: Movies (~/Movies)
2. Send Growl notification with pattern: (file) has been moved to Movies.
Rule Name: Archives
Condition Preference: Any
Condition 1: Extension is zip
Condition 2: Extension is 7z
Condition 3: Extension is sit
Condition 4: Extension is sitx
Condition 5: Extension is rar
Condition 6: Extension is bz
Condition 7: Extension is gz
Condition 8: Extension is bz2
Do the Following:
1. Move file to folder: Archives (~/Downloads/Archives)
2. Send Growl notification with pattern: (file) has been moved to Archives.
Rule Name: ISO
Condition Preference: All
Condition 1: Extension is iso
Do the Following:
1. Move file to folder ISO Images (~/Downloads/Installers/ISO Images)
2. Send Growl notification with pattern: (file) has been moved to ISO Images.
Rule Name: iWork Files
Condition Preference: Any
Condition 1: Extension is numbers
Condition 2: Extension is pages
Condition 3: Extension is keynote
Condition 4: Extension is doc
Condition 5: Extension is rtf
Condition 6: Extension is wps
Condition 7: Extension is docx
Condition 8: Extension is txt
Do the Following:
1. Move file to folder: Office Documents (~/Documents/Office Documents)
2. Send Growl notification with pattern: (file) has been moved to Office Documents.
Rule Name: Web Files
Condition Preference: Any
Condition 1: Extension is html
Condition 2: Extension is htm
Condition 3: Extension is php
Condition 4: Extension is asp
Do the Following:
1. Move file to folder: HTML Files (~/Documents/HMTL Files)
2. Send Growl notification with pattern: (file) has been moved to HTML Files.
Rule Name: iCal Files
Condition Preference: All
Condition 1: Extension is ics
Do the Following:
1. Move file to folder: iCal Files (~/Documents/iCal Files)
2. Send Growl notification with pattern: (file) has been moved to iCal Files.
Rule Name: Pictures
Condition Preference: All
Condition 1: Kind is Image
Do the Following:
1. Move file to folder: Downloaded (~/Pictures/Downloaded)
2. Send Growl notification with pattern: (file) has been moved to Downloaded Images.
Rule Name: Icons
Condition Preference: Any
Condition 1: Kind is IconsFileStore
Condition 2: Kind is Apple icon image
Do the Following:
1. Move file to folder: Icons (~/Pictures/Icons)
2. Send Growl notification with pattern: (file) has been moved to Icons.
Rule Name: Disk Images
Condition Preference: All
Condition 1: Extension is dmg
Do the Following:
1. Move file to folder: Disk Images (~/Downloads/Installers/Disk Images)
2. Send Growl notification with pattern: (file) has been moved to Disk Images.
Rule Name: PDF
Condition Preference: All
Condition 1: Extension is pdf
Do the Following:
1. Move file to folder: PDF (~/Documents/PDF)
2. Send Growl notification with pattern: (file) has been moved to PDF.
Rule Name: TV Shows
Condition Preference: Any
Condition 1: Name contains DTV
Do the Following:
1. Move file to folder: TV Shows (~/Movies/TV Shows)
2. Send Growl notification with pattern: (file) has been moved to TV Shows.
Rule Name: Applications
Condition Preference: All
Condition 1: Kind is Application
Do the Following:
1. Move file to folder: Applications (/Applications)
Options: If file exists: replace
2. Send Growl notification with pattern: (file) has been moved to Applications.
Rule Name: Windows Files
Condition Preference: Any
Condition 1: Extension is exe
Condition 2: Extension is msi
Condition 3: Extension is DLLs
Condition 4: Extension is thumbs
Do the Following:
1. Move file to folder: Windows Files (~/Documents/Windows Files)
2. Send Growl notification with pattern: (file) has been moved to Windows Files.
B. Archives (~/Downloads/Archives)
One beautiful thing about the Hazel interface is that you can drag and drop rules from one folder's to another. So if I'm browsing the Downloads rules and I find one that I would like applied to another directory, such as archives, I can just drag and drop that rule onto the Archives folder on the left pane.

I have copied the following rules from Downloads into Archives:
- Disk Images
- iWork Files
- Applications
- Packages
- Pictures
- Widgets
The only new rule for Archives that is not found in Downloads is Unarchived folders.
Rule Name: Unarchived Folders
Condition Preference: All
Condition 1: Kind is Folder
Do the Following:
1. Move file to folder: Extracted Folders (~/Downloads/Installers/Extracted Folders)
2. Send Growl notification with pattern: (file) has been moved to (folder).
This rule takes all folders that have been extracted from a zip file and moves them to a directory I created specifically for these types.
C. Disk Images (~/Downloads/Installers/Disk Images)
There's only one rule for this folder: detect old DMG files and move them to the Deletion Candidates sub-directory. I use this because I never remember which DMGs haven't been opened and which ones I should delete.

Rule Name: Old Disk Images
Condition Preference: All
Condition 1: Date Last Opened is not in the last 3 Days
Condition 2: Date Last Opened is not blank
Condition 3: Name is not Deletion Candidates.
**Sometimes, Hazel tries to move the watched folder into itself, generating errors visisble through Growl. The only solution I have found is adding a condition like this one.**
Do the Following:
1. Move file to folder: Deletion Candidates (~/Downloads/Installers/Disk Images/Deletion Candidates)
2. Set Color label (Red)
3. Send Growl notification with pattern: (file) has been moved to Deletion Candidates and has been flagged for deletion.
D. Installers (~/Downloads/Installers)
Similar to Archives, I have dragged over three rules from Downloads to make this directory:
- Packages
- Disk Images
- Archives
While these are not the extent of every Hazel rule I am currently using, the rules I have shown represent those affiliated with my Downloads directory. The workflow is pretty cool to watch, even if just from Growl.
II. The Unarchiver
The Unarchiver is a freeware unzipping app (or unarchiving app) that handles all of my archived files. I have it set to automatically when opened, extract its contents to the current directory and trash itself. When I double click an archived file in the Archives directory, the files appear, the original Archive moves to the Trash, and Hazel starts organizing the extracted files, alerting me through Growl for each action. Stuffit Expander can do the same, but The Unarchiver is free, and surprisingly has a better dock icon, GUI, and preferences dialog.
III. Growl
If you haven't already heard of Growl, you must not read lifehacker or MacWorld too often. Growl is a gem that offers global notifications for many programs. The best apps out there integrate Growl support into their code. As shown in my rule examples, Growl is integrated into Hazel and is a very powerful feature at that. Growl is also very easily themeable. I use the Smokestack (left hanging) Style, which I downloaded from http://mattrobs.deviantart.com/art/Growl-Smokestack-78608927
IV. Stacks
This is one of my favorite Leopard features. Stacks needs no explanation. I keep six stacks in my dock. From left to right:
- Extracted Folders (Sort by name, Display as Folder, View content as List)
- Disk Images (Sort by name, Display as Folder, View content as List)
- Archives (Sort by Date Added, Display as Folder, View content as Automatic)
- Downloads (Sort by Date Added, Display as Folder, View content as List)
- Recent Applications
- .Trash (Special Stack hack)
The most crucial one to my workflow is Archives. I can click the Archives stack, click on an archive file, and The Unarchiver goes to work. Upon completion, the files are moved else where. After a few clicks, the Archives stack is empty, my Trash has a few new files, and the contents have been moved elsewhere. This is handy for zipped Applications, for they are automatically copied to the Applications directory.
All in all, I have become much more productive by using Hazel. I have a few other ways in which I use this delightful application, which I will detail in other posts surrounding different organizational tactics I use on my Mac.