Taking Hazel 3 and the Inbox to the Next Level

SCREENCAST: https://www.dropbox.com/s/vde5b48znaphudq/Hazel2.mp4?dl=0
In the previous tutorial, I showed how to keep OS X clutter free with Hazel and a dedicated Inbox folder (LINK BEFORE PUBLICATION JOHNNY!).

In this tutorial I’ll show you how to use Hazel to automate how files are handled once they’re in the Inbox. I’ll cover how to use Hazel to archive folders on a monthly basis. These additional rules will take your Hazel workflow to the next level.
To get the most out of this tutorial you’ll need to have read my previous one on using Hazel and an Inbox folder to keep a Mac clutter free (LINK AGAIN). You’ll also need to have read Paula’s excellent introduction to Hazel rules if you haven’t done so already.

For obvious reasons, you’ll need a copy of Hazel 3. You can download one from developers website. It costs $29 but there’s a free 14-day trial. If you’re going to the effort of setting up any of the workflows in my tutorials, I’d ignore the free trial and just buy the app. If you spend a few hours setting up Hazel properly, having it stop working in two weeks time is just silly.

If you’re interested in Hazel, you’re probably using an application launcher like Alfred or Launchbar already. While not required for this tutorial, they will make some of the workflows easier and faster to trigger.

One of the workflows in this tutorial uses Hazel to trigger an Automator service. If you want to create similar rules, you’ll need to know how to use OS X’s Automator app. Once again, Paula has written an exceptional introduction.

Finally, I’ve created a resource pack of all the Hazel rules and the Automator workflow used in this tutorial. You can download them and either use them as they are or tweak them to suit your needs.
OS X Mavericks introduced Finder tags. They’re the perfect tool to use to trigger Hazel to act on certain files but not others.
As well as the general Inbox I covered in the last tutorial, I have a number of project specific inboxes. For example, for Tuts+ I have a Tuts+ inbox folder. Any files that I’m going to need for articles in the next few days get sent there. At anyone time there’ll be a mix of screenshots, screencasts, photos, app logos and archive files.
If I tag any file in my Inbox with a tuts Finder tag, Hazel automatically moves it to my Tuts+ inbox.
Create a project inbox for each major project you have. I have a Tuts+ folder on my Mac and I created @Tuts+ Inbox inside it. I did the same thing for the other sites I write for.
By default, Hazel only scans the top level of a folder; it doesn’t drill into the subfolders. For this rule to work properly, Hazel has to scan subfolders as well.

As I mentioned last time, Hazel runs each rule in order. To get Hazel to drill down into subfolders create a rule that matches any Kind is Folder and then does Run rules on folder contents. Place it at the top of the stack that targets the Inbox.
dive into folders rule
This rule gets Hazel to run on subfolders. Be careful!
If Hazel finds a folder, it runs any of the rules that follow on the files inside. If it finds another folder, it will drill down again. Be careful using Hazel rules that drill down into subfolders. I’ve had some interesting recursive results where everything has been sorted into a single folder with hundreds of sub-sub-sub-subfolders.

After the first rule, create another that matches any file with the target tag. Mine is tuts but you should select something more appropriate for yourself.
tuts move tags
Any file tagged with tuts gets moved to @Tuts Inbox.
For the actions, use Set color label to strip its colour tag and Move the tagged file to Tuts+ Inbox—or whatever your project inbox is.

To quickly assign tags to files, I use the application launcher Launchbar—but Alfred would work as well. You can use Finder’s context menu to apply tags but it’s far slower.
Using Hazel just to move tagged files is a little ridiculous. Setting up the first rule probably took me more time than it will ever save. Directly moving the files with Launchbar or Alfred is at least as quick as applying the tag and letting Hazel do it. What Hazel can do that Launchbar and Alfred can’t, is act on the files while they’re being moved.

My tutorials for Tuts+ rely heavily on screenshots. I take 20 or 30 for each one and pull out the most relevant. All the images on the site are 600 pixels wide but it’s very rare that the window I’m screenshot-ing is. Before I add them to the CMS, I need to resize them.

I considered using Hazel to automatically convert all screenshots to 600px wide but I occasionally need them in other sizes too. Instead, I created a rule that any file in the Inbox tagged with tutsimage gets resized to 600 pixels wide, converted to a .jpg and moved to my Tuts+ inbox.
Create an Automator workflow that resizes images and converts them to .jpg. You can either follow Paula’s tutorial on Automator or use the workflow provided in the resource pack.
automator workflow
The Automator workflow that resizes images.
Right-click on the first rule you created and select Duplicate. Modify it so that instead of matching the tuts tag, it matches the tutsimage tag—or whatever your equivalent is. Add a new action and select Run Automator workflow. Choose your newly saved Automator workflow.

Optionally, add a Remove tags action and remove Any Existing Tags then add a Add tags action and select your main project tag—in my case it’s tuts.
tutsimage rule
Any file tagged with tutsimage has a lot happen to it.
Now any image in the Inbox that’s tagged with tutsimage will be resized, converted to .jpg, moved to my Tuts+ Inbox and have the tuts tag applied.

By combining Hazel with Automator there is almost no limit to what you can do. For example, if you want to email files to your partner or convert them to PDF just by applying a Finder tag, it’s entirely possible.
As a freelancer, I’m in the unfortunate position of having to manage my own expenses. One of the most important things I need to do is keep track of my expenses so I can write them off against tax or claim them back from some of the sites I work for.

I’ve added an @Expenses folder to the Inbox and over the course of the month I add any receipts I can. When it comes time to send in invoices at the end of the month, any expenses I can bill for I do.

Once I’ve dealt with my expenses for the month, I need all my receipts to be archived somewhere for end of year tax returns. A lot of the workflows I’ve covered use a file’s date of creation as a trigger. That’s no use in this case. It doesn’t matter whether I buy something on the 3rd or the 28th, the expense is from the same month.

The following workflow is great for dealing with any of these weekly or monthly tasks.
Create an @Expenses folder in the Inbox and an Annual Expenses folder somewhere safe—I have mine in iCloud Drive. Set up a rule targeting @Expenses. Set Hazel to trigger if Current Time is 00:00 on the 1st of the month, or whatever time is more appropriate for you.

For the action, have Hazel Move the files to Annual Expenses and Sort into subfolder. I uses a YYYY - MM - MName - Expenses pattern.
expenses rule image
The rule that archives the files in @Expenses once a month.
At midnight on the first, all the files in @Expenses get archived to Annual Expenses whether they were created 30 days or 2 days previously.
Hazel is an amazingly powerful tool when you go to the effort to set it up. It does take time and tweaking to implement properly.
If you’ve followed both this tutorial and the previous one, you’ll have a complex structure of related folders that Hazel moves files between. It should keep a Mac clutter free and automate some common tasks. You should also be getting a good insight into how Hazel can fit into your workflow.
If these posts have got you implementing Hazel, or you’ve found some great rules, please let me know in the comments below.


Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation.


Copyright @ 2013 KrobKnea.

Designed by Next Learn | My partner