04.01.2021»»понедельник

Hazel Mac App

04.01.2021
  1. Hazel Macos
  2. Hazel Rules
  3. Hazel Mac App For Iphone
  4. Hazel Mac App Download

Dec 27, 2019 It's too difficult to really express how powerful this app is, but if you like to automate stuff on your Mac, Hazel will allow you to do an amazingly deep array of actions. It goes far beyond merely cleaning up files on your desktop and downloads folder. “Hazel's combination of power and ease of use makes it one of the handiest Mac utilities I’ve used” Dan Miller “I honestly believe Hazel is a killer - nay: essential - appcan't even begin to guess at how much time it's saved me.”. Dec 27, 2019 Superb app. Hazel 3.x has become a really powerful app. Here are some of my usages of Hazel: (1) I monitor a folder on my laptop. Whenever a file is dropped into that folder, it is automatically uploaded to a web server by sftp and automatically updates a website. (2) automatically deletes old files in the Trash folder. Dec 27, 2019  Superb app. Hazel 3.x has become a really powerful app. Here are some of my usages of Hazel: (1) I monitor a folder on my laptop. Whenever a file is dropped into that folder, it is automatically uploaded to a web server by sftp and automatically updates a website. (2) automatically deletes old files in the Trash folder.

When we do an internal poll of the Asian Efficiency team or ask our Dojo community for their favorite Mac apps to be productive, there is one that is always near the top of the list: Hazel.

It is one of our key applications to free up time, eliminate annoying manual tasks, and to make the macOS experience better. It is consistently in the top 10 of our Essential Mac Apps list every year.

What Is Hazel?

Now that we’ve hyped it up, the natural question is: “what the heck is Hazel?”

Noodlesoft, the creators of Hazel, describe it as “Automated Organization for Your Mac”, and that is a great tagline. Here’s what they have to say about it:

Hazel watches whatever folders you tell it to, automatically organizing your files according to the rules you create. Have Hazel move files around based on name, date, type, what site it came from and much more. Automatically sort your movies or file your bills. Keep your files off the desktop and put them where they belong.

Essentially, you tell Hazel to watch a folder (or multiple folders), set some rules you want Hazel to watch for, and when something happens in that folder that matches one of your rules, take some action that you define.

To use the app correctly, you just have to understand very basic if-then logic. In other words:

If X-condition(s) are true, then do Y-action(s).

For example, you can setup rules (as Hazel calls them) like the following:

  • If a file is in the Downloads folder and is bigger than 1GB and hasn’t been opened in 2 weeks, then move it to the trash folder.
  • If the file name contains “invoice”, then color it green and make a copy in the Finance folder.
  • If a file on the Desktop hasn’t been opened in the last 24 hours, move it to a “Desktop To Review” folder.

There are so many ways you setup rules. They can be very simple, or you can have multiple conditions and multiple actions so you can really make it as complex as you want it to be.

You can even have Hazel run shell scripts or Applescripts, so what you can do with your files is almost unlimited. If you don’t know what any of that means, not to worry — no programming is required with Hazel. Anyone can learn it.

What About Hazel For Windows?

Hazel is a Mac application, and there isn’t a Windows version. If you use Windows, there are alternatives. DropIt is a popular open source tool that can do much (but not all) of what Hazel can do. You should be able to do many of the tasks outlined here on Windows with DropIt.

Why Automation Matters

Why use a tool like Hazel at all? Here is a comment from an Asian Efficiency reader that is by no means unusual:

I’ve been trying Hazel for the past few days with the trial, and I just don’t get it. It seems that it’s for people who don’t know what’s going on with their file system. I don’t need something to monitor my download folder and move things to other folders automatically – I move things to where they should go myself. Sorry, I just don’t get it – Hazel causes more problems than it solves IMO…

Many people who try automation tools like Hazel and TextExpander don’t “get it” at first. How hard is it to rename, move, or manipulate a file? How hard is it to type?

At Asian Efficiency, we live by something called the “3 Times Rule.” If something bothers you 3 times, find and implement a permanent solution for it.

This can apply to things that don’t bother you too. If you find yourself doing repetitive tasks manually that could be automated or outsourced, why not find a solution to take it off your plate? Awesome Asian Efficiency reader Scott says it well:

Look for areas in your workflow where you find yourself doing repetitive tasks with files, then see if there is a way to have Hazel help automate that for you so that you can get on with bigger and greater things. It’s not just about maintaining your file system, but also about automating tasks to free up your time and attention.

The value of freeing up time and attention for things that actually matter can’t be overstated.

Hazel Quick Wins

Now that we’ve made the case for Hazel as a tool, let’s look at some quick wins that will get you started.

When you install Hazel, it automatically adds your Downloads folder and installs some sample rules. It’s highly recommended that you poke through those rules and get a feel for how a Hazel rule is set up before starting with your live important files.

If you ever want to get to your Hazel rules, click on the broom icon in your menu bar and choose Open Hazel….

The key thing to know about the Hazel interface is that it is split into two sections: Folders and Rules.

The Folders section on the left is the list of the folders that you want Hazel to watch. To add a folder, drag it into that window from the Finder or click the + button to add it.

The Rules section on the right lists the rules you have set up for the selected folder. Hit the + button to add a new rule or double-click on an existing rule to view/edit it.

Let’s start with a few simple rules.

Clear Off Your Desktop

The Desktop can be a convenient place to temporarily store files, but it can quickly become a cluttered mess. We’re going to create a rule that moves any file that hasn’t been opened in one day to a folder called “Desktop To Review”.

If you’d like, you can have Hazel delete the untouched files, but we’ll be safe and sweep them to a folder to look through later.

First we’ll (1) add the Desktop folder by hitting the + button in the Folders pane or dragging it in. Then, we’ll (2) hit the + button in the Rules pane to add a new rule.

Next, we’ll tell Hazel that we want to:

  • Watch for any files that were created more than a day ago
  • Ignore folders (we only want to look at files)

We also tell Hazel we want it to:

  • Move any of these files to the “Desktop To Review” folder

One we hit OK to save it, here it is in action:

Automatically move and clean up old screenshots

macOS has a handy built-in screenshot feature (if you haven’t tried it yet, hit ⌘-Shift-4, and select part of the screen).

By default, these screenshots they get stored on your desktop. You can delete or move them yourself, but why not let Hazel do it for you so you don’t need to think about it?

If you’d like, Hazel can delete them for you, but I like holding them in a folder (~/Pictures/Screenshots) for a while just in case.

Here’s a rule that will move screenshots older than an hour:

This is great, but now you’ll have a ton of screenshot images in ~/Pictures/Screenshots.

Not a problem. You can make a second rule for Hazel to delete very old screenshots. If you collect all screenshots in a separate folder but never empty it, you’re wasting a lot of space. So make sure you make a new rule for your screenshot folder that deletes files older than, say, 4 weeks.

Add the Screenshots folder to Hazel by pressing on the plus sign in the folders pane (or drag the Screenshots folder in), then add this rule:

Clean Up Your Downloads Folder

Over time your Downloads folder can become a mess and can take up a lot of space. Here are some strategies for taming it.

Remove DMG files

When you download and install a Mac app outside of the App Store, more often than not you will download a DMG file.

Once you install the application, you probably don’t need that DMG file anymore. If you’d like, you can use Hazel to sweep them away to another folder or to an external hard drive. In our case, we’re going to create a rule that deletes them after a day.

Sweep Old Files

Similar to what we did with the Desktop, you can keep your Downloads folder clean by moving old files to another folder for further review, or (if you’re brave) you can delete them.

Follow the instructions for “Clear Off Your Desktop” above, but create the rule for your Downloads folder.

Sort Your Downloads

If you like things to be nice and organized, Hazel can automatically sort files into subfolders for you by criteria like date, extension, or type. Here’s how to keep your downloads folder sorted by type for files older than 1 day.

To select kind, click into the with pattern box. You’ll see you have a number of different options. The date ones can be particularly handy.

Here’s the rule in action:

Highlight Apps You Never Use

How often have you tested out an application on your Mac and then never used it again? This rule will use the handy Set color label feature to highlight the apps we may want to get rid of.

If there’s any application in the /Applications folder that hasn’t been opened in a year, it will turn it purple.

Hazel Macos

If you then sort your /Applications folder by Tag, you can quickly see which ones should be reviewed. It looks like I have a bit of cleaning to do.

Clean Out Your Trash

Many of us are not the most diligent at cleaning out the Trash in macOS. This is great if you need a file later, but not so great if you want to save hard drive space.

Assuming you have an effective backup system in place, you can have Hazel monitor your Trash and clean it out periodically or when it gets to a certain size. Let’s have Hazel clear out the Trash every two weeks.

This time we won’t be creating a rule, but adjusting a setting. Go to Hazel and go to the Trash tab. Check the Delete files sitting in the Trash for more than checkbox, and set the time period you want to keep files for.

Just remember, once files are gone from the Trash, they’re gone. Be careful with this setting.

Move Saved Email Attachments

Hazel can be a handy tool for archiving files received via email.

If you want to save your important attachments outside of your email program, you can save them to a central folder and then set up rules for Hazel to move your attachments for you.

We wrote about how to handle email attachments, and that article gives an example for doing this.

Hazel Power Moves

We’ve gone through some quick wins you can achieve with Hazel, but it’s time to take things to the next level. Here are some more technical examples of what you can do with Hazel.

Automatically Move Paperless Documents

Hazel is an absolutely killer tool for processing your paperless documents.

We recommend creating a central folder to act as an inbox, and have everything you can and download go to that folder.

Then you can use Hazel to watch that folder and automatically rename and move your PDFs based on the rule you set up.

You can have it move and rename based on the name of the document, but you can even have it look inside the PDF at the contents and move and rename based on text inside the document. It can even grab the date out of the PDF and use that in your file name (!).

We’ve written about using Hazel with your paperless documents before, so check out that detailed tutorial.

That workflow is good, but if you want to make use of the date in the PDF, you’ll need to set a criteria for Contents and then contain match. Choose Custom Date.

We’re creating a token here, and call it stmt date. Use Month, Day and Year to build the pattern that Hazel should look for, but the key is that the pattern must match the date format in your PDF.

For example, if you had a bill with a date that looks like this:

Then your Hazel token would need to look like this:

Things like spaces, slashes, and commas matter. This can be a pain to get right, but once you do it is extremely powerful.

Once you have your token saved, you can use it in the Rename step. Going off the example from our paperless article, here is what the new action section would look like:

Now it will grab the date from the bill, use that date in the name, and rename it with our naming convention and move it. This takes so much of the heavy lifting out of going paperless.

Rename downloaded files

If you download statements, reports, or other files, they are probably not named in the format you want. Fortunately, Hazel can help.

For example, my bank has a report where the downloaded file is named eStatementyyyy-mm-dd.pdf, where yyyy-mm-dd, of course, the date of the report.

I want the file to be named yyyy-mm-dd-XYZ Bank.pdf instead. In plain English, what I want to do is:

Get rid of everything before the date, use the date, and then tack -XYZ Bank after the name.

No problem. There are many ways to do this, but let’s do it the name-manipulation way and do it in a way that we are being extra-safe that it will grab the right file.

Create a new rule and for the criteria, set it to Name and matches. Click into the white matches box and you will see a popup.

In this box we will be telling Hazel to do two things:

  1. Look for a file named with a certain pattern.
  2. Grab part of that file name and put it into a token so we can use it later.

First, we want to tell Hazel to look for a name starting with eStatement. Click on the dot beside Custom text. It will open up yet another popup, and this time we want to give our token a name (this one doesn’t really matter) and in the Type text field, I have eStatement. This has to exactly match what we’re looking for in the file.

Hit Done.

Next we want to create another token for the part of the filename that contains the date. If we wanted to manipulate that date we could use the Custom Date type, but in this case let’s keep it simple and just use Custom text again. Click on the blue dot beside Custom text.

This time we are going to keep it low tech. We want to tell Hazel that we want it to look for the part of a file that has a number, then a hyphen, then another number, then another hyphen, then another number.

I gave it a name “stmt date”. Hit Done.

Here’s what my Matches popup looks like:

Hit Done.

Now that we have our matching done, we’ll tell Hazel to rename the file. For the action, choose Rename and get rid of the part of the filename that says name. We don’t care about the exiting name.

Instead, click on the “stmt date” token we created earlier and then type -XYZ Bank after it. Here’s what my rename pattern window looks like:

Now when I save the rule, Hazel will look for anything named eStatementyyyy-mm-dd and rename it to yyyy-mm-dd-XYZ Bank.

As I mentioned, there are other ways to do this (especially with PDFs), but I wanted to show you the power of tokens and how you can use them to take information from one place and use it in another.

Create new task in OmniFocus when a PDF bill arrives

A common worry when going paperless is making sure bills are paid on time — how can we remember to pay our bills if we don’t see them sitting there?

The Asian Efficient way is to set up auto-pay, but for some bills you can’t or choose not to.

A solution is to set up Hazel to watch a folder for your bills, and then have it create a task in OmniFocus to remind you to pay it.

This can be done with an AppleScript, and here is how to create an OmniFocus hotspot to do just that. There’s even a sample rule included.

The Preview Button Is Your Best Friend

When you are building complex rules it can be helpful to test as you go along. Thankfully, Hazel has a Preview button to help.

Hazel

Let’s go back to our file-renaming rule from earlier. We’re going to tell Hazel to look at a document that we think should match the rule. We do that by hitting the Preview button.

Once you hit the button, choose the document you want Hazel to watch and hit Open.

Right away you’ll see a green checkmark beside each step that the sample document matches.

If a step doesn’t match, there will be a red x.

You can double-click on one of the red x’s and it will tell you what part doesn’t match and what it sees instead. You then have something to investigate.

Copy Tax Receipts

When you’re downloading a receipt (or you captured it with your phone and uploaded it to Dropbox), you can have Hazel watch a folder, watch for a part of a name, and then move and rename it. This can be handy for tax receipts.

When I am saving a document, I might want it to go to my normal filing system, but I might also want it to go to a Dropbox folder that I share with my bookkeeper. I do that by having a Hazel rule look for anything that has “-taxbd” at the end.

By now this should be pretty standard Hazel for you. Look for a file that’s name ends with some text, and copy it to a folder. The key is that little icon you see in the name attribute in the Rename with pattern box.

When you (1) click on one of the attributes, you have some options. In this case, I (2) chose Replace text.

In this case, I’m telling Hazel to replace -taxbd in the file name with blank text, effectively chopping it off. This way I get the benefits of using this text to tell Hazel to do something without it cluttering up my file names.

Automatically Resize Images

If you are constantly having to resize images to a certain width, you can set up a folder and have Hazel watch it and do the resizing for you.

Now, Hazel itself can’t resize images, but this example shows how the power of Hazel is almost unlimited. We’re going to have it run a shell script and do the resizing for us.

I created a “To 800” folder, and created a Hazel rule that looks for images. I like to put in a safeguard and have it only run if the Pixel Width is greater than 800. Pixel Width isn’t one of the default options. First choose Other… and then scroll down or search. You’ll find it.

Next it’s time to do a tiny bit of scripting. In the action section, choose Run shell script. Then click on Edit script.

Now you have a script window opens up. Paste or type in this command:

sips -Z 800 '$1'

sips is a command built into macOS and $1 is what Hazel will use to substitute in the file it is working for.

Hazel Mac App

Now Hazel will watch for any image you drop into To 800, check if it is greater than 800, and if so run sips to resize it.

(Hat tip to Jacob Salmela for this tip.)

Automatically Import To Evernote

For some reason, the Windows version of Evernote comes with import folder functionality, but Evernote for Mac does not. Never fear though, as a Hazel expert, you can make your own.

We’ll create a To Evernote folder and create a Hazel rule that uses AppleScript to add to Evernote.

Here is, at a high level, our rule:

Now let’s click on Edit script to see the magic.

It’s pretty simple. Here’s the AppleScript code to paste in:

theFile is Hazel’s placeholder for the file it is processing.

If you have problems with it, sometimes you need to change the first line to:

tell application id 'com.evernote.evernote'

You can do a lot more with this, like automatically adding tags or moving it to specific notebooks. Here is Evernote’s AppleScript reference if you want to get really geeky.

Only move non-secure PDFs to Evernote

Sometimes we may want to copy documents or other files to Evernote, but don’t feel comfortable storing sensitive information there. Here is one way you could protect yourself:

This is the same as the last rule, and uses the same AppleScript. But now it has a condition where it will only copy the file to Evernote if it does not contain one of the account numbers listed. You can list social security numbers, credit card numbers, account numbers, or any other sensitive text you wouldn’t want uploaded to Evernote.

What Will You Do With Hazel?

Believe it or not, we are over 3,500 words and we have barely scratched the surface of what Hazel can do.

If all these examples are overwhelming, just pick one to implement, play around, and get to know the tools. You can implement the other ones later if they would help you.

Hazel Rules

Do you have any killer Hazel workflows you’d like to share? Is there anything you wish you knew how to automate but don’t know how? Leave a message in the comments below.

The Hazel Video Field Guide is a two-and-a-half hour video screencast that teaches you everything you need to know about Hazel, one of the best tools available to automate using your Mac. You can start the screencast without knowing a thing about it and by the end of the screenccast you'll be using Hazel to automate everything from filing your bills to having your Mac play some of your favorite music as you arrive home. There is a lot you can do with Hazel and this screencast explains it all including:

Hazel will manage your documents for you. Not only can Hazel help you name and file documents, it can also reach inside documents and look at their contents and then use that data in naming the file and putting it in the right place. Hazel is a document management beast and both more efficient and reliable than having a human manage electronic documents. Hazel is also an excellent copilot as you start tagging files. Some of the workflows in this Video Field guide explain how to automatically apply tags to categories of documents so you have the benefit of tagging without the work of creating them.

Hazel Mac App For Iphone

Hazel can do a remarkable job of cleaning up after you on your Mac. Hazel can keep an eye on any folder on your Mac, including your downloads folder and your desktop, and keep things nice and tidy. Set your rules once and never have a messy computer again.

Sorting and filing your media is a pain in the neck. Hazel can take this burden on for you. Using Hazel, you can have your images automatically filed in the Photos application or you can have Hazel automatically sort and organize folders full of images by their date. You can even use a Hazel to automatically rename your images while you're organizing them. Hazel can also manager music for you. Hazel has the ability to automatically import new music into iTunes so you don't have to.

Not many people realize what a powerful tool Hazel can be for automation. Hazel is always watching. It will jump into action with something as simple as a new text file being added to your hard drive. Moreover, once Hazel kicks in, it can do just about anything on your Mac. One section of this Video Field Guide demonstrates how you can use AppleScript and services like IFTTT to easily create automation scripts for your Mac. One of the sample Hazel workflows will automatically lock your Mac when you leave your house. Another will play your favorite music when you arrive home. Once you understand how these work, and I demonstrate every step, you can alter the scripts to make your Mac do just about anything you want at anytime you want.

Another common pain point for Mac owners is managing the trash. If you're not watching it, your Mac's trash can fill up your hard drive. Hazel takes care of this problem for you with the ability to automatically empty the trash after a set period of time or when the trash gets to a predefined size. The settings are easy and completely remove this problem from your life. Likewise, Hazel can also take care of deleting and restoring applications from your Mac. Hazel doesn't just delete the application but all those obscure resource files that are scattered over your drive.

Hazel does the tedious work so that you can do the important work. This lovingly crafted video is just shy of two-and-a-half hours. There are 35 chapter markers and the video covers every aspect of this super-powerful Mac application. The thing I love most about Hazel is the way it can take any mere mortal and turn them into an automation god. Literally anybody can do this. You don't need a lick of programming knowledge. Who doesn't want to wield super-powers over their technology?

Hazel Mac App Download

The Hazel Video Field Guide assumes that the viewer has no knowledge of Hazel and starts with the basics but by the end ramps up to advanced techniques.