7 Awesome Hazel Rules You Can't Live Without
Posted 07/01/2011 at 9:48am
| by Cory Bohon
From Automator to AppleScript, the Mac has a lot of great automation tools built right in; however, these tools can sometimes be a little intimidating for novice users. Hazel is a system preference pane that remedies this by giving users some powerful sorting tools, but with a super-simple rules-based interface for configuring file-sorting options on their Mac.
Hazel works by monitoring a specific folder for files that match rules that are specified by the user. When a file appears in that folder matching the rule, you can specify an action. Actions can be as simplistic as notifying you via Growl, or as complex as taking the file and adding it to Evernote and beyond. We’ve compiled 7 awesome Hazel file-sorting rules that you won’t be able to live without.
1. Remove Unused Apps
Open Hazel (located in System Preferences > Hazel > Folders), and click the plus (+) button in the Folder sidebar. Select your Applications folder, and then click Open.

Be sure to type a name for your rule so you know what they do.
Next, click the plus (+) button in the Rules section on the right-hand side of the window. In the Rules dialog that drops down, add the following conditions: Date last opened Is before This month, Extension is “app”, and Subfolder Depth is less than “1”.
In the “Do the following” section, specify “Move file” and select “Other” from the folder drop-down menu. Create a new folder wherever you would like. We created a folder called “Unused applications” in our applications folder. When you have finished, click the OK button. Now, whenever this rule is run, applications that haven’t been used in the current year will be moved to this folder. From here, you can delete the applications from your Mac, giving back valuable disk space.
2. Archive Older, Larger Files

You can optionally choose to have the files discarded in the Trash automatically.
Older files, especially those bigger in size, can really eat up disk space on your Mac. Hazel makes it easy to archive these files, however. Simply select your user’s Documents folder, then set the conditions to Size Is greater than 100 MB; and Date last opened is before this year. You can tweak the size matching to meet your specifications. As for the action, select to Move files to an archive folder that you create on your Mac. When run, this Hazel rule will archive your large, old files into a single folder that you can move to an external hard drive for safe keeping until you need them.
3. Auto-add PDFs to Evernote
Evernote is a great place to store documents because they become instantly searchable on all of your devices. But, with Hazel, we can have our PDFs automatically appear in Evernote without lifting a finger. Simply select your folder, then choose the following condition: Extension is “pdf”.

We use this with our Downloads folder, but you can choose a different folder to use this rule with.
In the actions section, select to Run AppleScript, Embedded Script, and click the Edit script button. Type in the following AppleScript:
tell application "Evernote"
activate
create note from file theFile
end tell
Next, add another action to Move file to folder: “Trash.” When this Hazel rule is run, any PDFs will be imported into Evernote and moved to the Trash afterwards.
4. Automatically Start Amazon MP3 Downloads
Amazon MP3 can sometimes have better pricing than iTunes, but we don’t like having to fuss with an external application to download our music. Hazel can help alleviate this pressure by automatically starting the download whenever an Amazon MP3 file is detected in your Downloads folder. To do this, create a new Hazel rule around your Downloads folder, and fill in the following conditions: Extension is “amz”.

Hazel will automatically begin downloading your Amazon MP3 songs with these rules.
Next, in the “Do the following” section, select Run AppleScript Embedded Script; then click the Edit script button and type in the following AppleScript:
tell application “Finder”
open file theFile
end tell
When you are done, click the OK button. Now whenever you have an Amazon MP3 download file in your Downloads folder, the Amazon MP3 Downloader application will automatically launch and begin download your music.
5. Synchronize iChat Logs with Dropbox

Now your iChat logs from one Mac will be available on all your computers through Dropbox.
This Hazel rule can be used with any folder you wish to synchronize with Dropbox, but especially comes in handy when you want to synchronize and archive your iChat logs with the file syncing service. To do this, create a new Rule for the folder “iChats” in your user’s Documents folder. Select “Any File” for the conditions; and, for the actions, select “Copy file to folder,” then select a Dropbox folder of your choosing. Next, click the Options button and check the box labeled “Do not copy if a duplicate” and select to “Rename” if file exists.
6. Keep Your Desktop Clean
Our Desktops typically accumulate temporary files as we move throughout the day, but if you’re giving a presentation, and you don’t want everyone to see that new Justin Bieber album you downloaded, let Hazel keep your Desktop squeaky clean.

Now whenever a day-old file is on your Desktop, it will be whisked away to an alternate folder.
For this, we’ll create a new Rule with the conditions set as Any File and Date Last Opened is before Today. Next, have Hazel Move the file to a folder that you create. We created an Alternate Desktop folder that Hazel can stash all of these files in.
7. Automatically Import Downloaded Photos into iPhoto

Whenever you put images into your Downloads folder, the images will automatically be imported into iPhoto.
Sometimes you may run across photos in your email or on a family gallery page on Flickr that you want to save in iPhoto. With this rule, all you have to do is stow the image files you wish to save in iPhoto in your Downloads folder and Hazel will take care of the rest. Make the conditions match Kind is Image; then, in your actions, set an action to Import into iPhoto to album Photos. You can optionally move the image files to the Trash after the import with a new action.
Follow this article's author, Cory Bohon on Twitter.