Preview a Rule

As you create rules, it can be helpful to check them against the files and folders already in the target folder so you can be sure your conditions match all and only the right items. Hazel offers two ways to do this: a live preview (which works on just one file at a time) and a “Rule Status” view (which shows which rules match each of the files in the target folder, and can be used either as a preview or after the fact).

To preview a rule with a single file:

  • Choose Rule > Preview Rule or press  -Option-P.

  • Select a file or folder within the monitored folder to preview against the rule and click Open.

If the rule as a whole (taking into account all conditions) matches, “Rule matches” appears above the conditions. If not, “Rule does not match” appears.

Note the following:

  • Turning on Preview Rule only tells you whether the conditions match; it does not run any of your actions if they do.

  • Preview Rule works even when a rule is disabled.

  • With Preview Rule enabled, you can select other rules  in the same folder  to see if they match the item you selected.

In addition to showing whether the rule as a whole matches, each  condition  that matches the selected file displays a green check mark  ; each condition that does not match displays a red X  . You can click either of these items to see a popover with the current value of the attribute in question as well as any  custom attributes  you’ve defined.

You can also drag this popover to detach it from the window:

When it is in this mode, the popover will stay open while you edit your rule. You can close it by clicking the close   button in the top-left corner.

As you modify your conditions, the icons change in real time to reflect the current match state for the selected file or folder.

To turn off the live preview, choose Rule > Turn Off Rule Preview or press  -Option-P.

Although Hazel’s live preview gives you quick feedback for a selected file or folder, you may instead want an overview of which rules match all the items in a folder. Hazel’s rule status interface enables you to do so—see  Show Rule Status  for details.


Show Rule Status

Create a Rule

Enable, Disable, or Pause Rules