Automating Your Mac: Sorting With Hazel

SUPPLIES: Next Step and Helpful by HeatherT.


Today we’re talking about Hazel, an automation program for Macs! Hazel is pretty amazing in what it can do. It takes a little brain power to wrap your head around the commands, but once you do, it can really do a lot of automation work for you! Let’s take a look at how to use Hazel to move files from your download folder to your supplies folder, unzip them, and combine them by kit into one master folder. (NOTE: This workflow will not work on every download, but since most designers name their files by designername_kitname, we can harness that to our advantage.) Let’s get started!

  1. Install the trial or full version of Hazel.
  2. Once installed, Hazel will add a broom icon to your menu bar.

  3. Click the Hazel icon and choose STOP HAZEL so that nothing is running in the background while we are still working. Then click it again and choose OPEN HAZEL. This will bring up Hazel in the System Preferences panel. You can also get there by clicking System Preferences and then Hazel.
  4. Hazel works by first identifying a folder to watch, and then adding individual rules to that folder. Because I download directly to my desktop, my first rule had to be created for my Desktop folder. So, click the PLUS icon and select the folder where your downloads are saved to.

  5. Now, look in the rules section to the right and click the PLUS button to add a new rule. Let’s name the rule Unzip. Then, change the settings so it reads:

If ANY of the following conditions are met

EXTENSION IS zip

Do the following to the matched file or folder:


UNARCHIVE
MOVE to folder: SUPPLIES (This folder is where you store your digifiles)

Click OK.

Now we need to run an new rule on our Supplies folder.

  1. Under folders, click PLUS and choose the Supplies folder.
  2. Add a new Rule and name it CombineKitFolders. Change the settings so it reads:


If ALL of the following conditions are met:
KIND IS FOLDER (Click + to add another rule)

DATE ADDED IS AFTER DATE LAST MATCHED (Click + to add another rule)

NAME MATCHES

Here it gets a little complex. It brings up a window where you need to create a custom variable. So, click the
CUSTOM • button. Name the Custom pattern designername_kitname. In the next box, click to add Word abc, then Symbols %?@, then Word abc. Click DONE.

You get popped back to the Custom dialog where • designername_kitname now appears. We then need to add Anything … to the formula.

What we’ve done is told Hazel to look for folders that have the same text like the designer name (abc) followed by the same symbol like _ or – (%?@) followed by the kit name (abc), followed by any other text that doesn’t have to match. Brilliant, right? Click DONE again.

Now, let’s finish the rule. We need to tell Hazel what to do once it finds the matching filenames. Change the last section so it says:

SORT INTO SUBFOLDER with pattern • designername_kitname (when you click the last box, choose the custom pattern we created earlier)

This tells Hazel to create a new folder named abc symbol abc (hopefully designername_kitname) and put all the other matching folders inside it.

Click OK.

Now it’s time to turn the Hazel rules on.

  1. Make sure that CombineKitFolders is checked to be turned on.
  2. Go to the Desktop folder and turn on Unzip.
  3. Then go to the Hazel icon and choose START HAZEL.


To test, download several zip files from the same designer to your downloads folder and watch as Hazel unzips it, deletes the original zip, moves the folders to the supplies folder, and combines them into one folder like magic.

If you have a kit that is in only one download, you may get an extra folder which you can remove later. But the vast majority of my purchases come with more than one download.

I’m now addicted to Hazel! Here are some other ways we can use Hazel.

  • Resize images for the web by associating them with an action in Photoshop and automatically upload them to an FTP. You’ll need to learn how to save an action as a droplet to do that. (Go to FILE>AUTOMATE>CREATE DROPLET and choose your action to save an “app” version of the action to your computer. You can then point Hazel to run that “app.”)
  • Monitor the downloads folder for music files, import them into iTunes and move them over to a backup folder.
  • Archive layouts over 30 days old by moving them to the EHD.
  • Color-code or tag files that have not been opened in a specified period of time and either move, backup or delete them.
  • Monitor digi supplies folder and move any kits that have not been opened in the past year to EHD.


Do you have Hazel? How do you use it? Share your recipes in the comments!