Hazel "Best Practices" thread

From your noodle to other noodles. Talk about ways to get the most from Hazel. Even exchange recipes for the cool rules you've thought up. DO NOT POST YOUR QUESTIONS HERE.

Moderators: Mr_Noodle, Moderators

Hazel "Best Practices" thread Tue Aug 04, 2009 12:02 am • by gcoghill
I find myself coming back to Hazel every so often, and geeking out trying to make it do even more than I had been previously. Sometimes it takes a while for the power of Hazel to "sink in", and other times it's just a matter of deciphering the proper rule logic to make everything work properly.

I had been wishing for some sort of "best practices" page or thread to help me wrap myhead around some of the rules and actions in Hazel. Since I never found one, I thought I would start it myself :)

(I suggest each user that posts a "best practices" tip here makes sure to edit the subject line of their reply so we can easily sort out and find these individually.)

I'll start things off with a reply (below).
gcoghill
 
Posts: 266
Joined: Tue Sep 18, 2007 8:09 am
Location: Kent, OH

Sorting files into monthly & yearly archives Tue Aug 04, 2009 12:13 am • by gcoghill
Sorting files into monthly & yearly archives:

I have some rules on various folders set up to sort my files into date-based archives. For example, I have my Downloads folder set up to process any files left in the folder after a week to be sorted into a Monthly archive, and then after 6 weeks into a Yearly archive. After a week is up, Hazel will move any files added in say June to a folder which Hazel auto-created (based on a rule). The folder is named "2009-06". After the current month is over, the monthly folder is then moved into a Yearly archive folder, again auto-created by Hazel. In this case it would be created using the "Date Created" attribute.

One thing I have discovered for all such time-based archives or file/folder processing is that it's best to set as one of the rule conditions the following:

"Date Last Matched is not Today"

Since these files only need to be checked once a day to see if they fit the "1 week" or "not this month" criteria, there's no reason to have Hazel constantly analyzing these files. In my usage, I also add some color label "aging" to the files as they approach the 1 week mark—Added Today = Green, 3 Days = Red. Without the "Date Last Matched is not Today" rule, Hazel would constantly be matching these files.

I believe Hazel is smart enough to not keep adding the color label each time (I think I read this somewhere on the forums before). But I see constant Console messages about Hazel matching rules that only need to be checked once a day to see if they are "old enough" to have label colors change or move to an archive. No need to be checking these every time Hazel runs.
gcoghill
 
Posts: 266
Joined: Tue Sep 18, 2007 8:09 am
Location: Kent, OH

Processing New Files Only Tue Aug 04, 2009 12:19 am • by gcoghill
Processing New Files Only

Here's a tip for processing only new files added to a folder:

Use the rule "Date Added is after Date Last Matched"

This is best used with a "Run Rules on Folder Contents" rule placed as the first item in the rule order.

What this does is checks all the files in a folder, and then only runs the action if the file is new since the last time Hazel processed the folder. In some cases, adding "Date Last Matched is Today" also helps if you are adding new rules to folders Hazel is already watching. This would be done if you do not want Hazel processing all the files retroactively.

I found this tip in many places on the forums here.
gcoghill
 
Posts: 266
Joined: Tue Sep 18, 2007 8:09 am
Location: Kent, OH

Giving a Folder Some Time Tue Aug 04, 2009 12:25 am • by gcoghill
Giving a Folder Some Time

This might be obvious, but I had a kind of a 'eureka' moment when I realized by adding multiple "Date Added" conditions, I could control the processing a little better when desired.

To process only files created Today, but not process them immediately, add two "Date Added" rules:

• Date Added is Today
• Date Added is not in the last XX hours

Another method would be:

• Date Added is in the last 6 hours
• Date Added is not in the last 3 hours
gcoghill
 
Posts: 266
Joined: Tue Sep 18, 2007 8:09 am
Location: Kent, OH

Re: Hazel "Best Practices" thread Tue Aug 04, 2009 1:47 am • by sjk
Thanks for starting this thread.

I'd like to encourage posting screen images of the rule interface corresponding to some of descriptions when it could help make understanding easier.
sjk
 
Posts: 332
Joined: Thu Aug 02, 2007 5:43 pm
Location: Eugene

Re: Hazel "Best Practices" thread Tue Aug 04, 2009 2:01 am • by gcoghill
sjk wrote:Thanks for starting this thread.

I'd like to encourage posting screen images of the rule interface corresponding to some of descriptions when it could help make understanding easier.


Yeah that's a good idea. When I posted these, I was trying to get them down while they were still fresh in my mind. Hopefully I can go back and edit and add some screenshots in the near future.
gcoghill
 
Posts: 266
Joined: Tue Sep 18, 2007 8:09 am
Location: Kent, OH

Re: Hazel "Best Practices" thread Tue Sep 08, 2009 10:07 am • by matt!
Thans for the "Date Last Matched is not Today"

great tip that solved an issue for me
matt!
 
Posts: 10
Joined: Thu Jun 19, 2008 7:41 am
Location: Cornwall, UK

Re: Hazel "Best Practices" thread Sat Dec 11, 2010 11:57 pm • by dhy8386
I think we should revive this thread but instead, i wonder if Mr Noodle would be open to creating a user managed (or moderator managed Wiki). I think this would be great for Hazel. There are some golden nuggets spread throughout the forums and they would be best managed in a wiki-like environment. By making it user managed, Mr Noodle does not have to manage it routinely but can check in on it to make sure he likes what he sees. I am thinking something like what lime-technology has (the creator of unRAID) - either Mr Noodles "Official" content as well as user generated content or just a user managed one. It would be different than here because despite the tips and tricks thread, people look at these forums as support places. The wikis would be more controlled and filtered and thus (in my mind any way) a better source of how to actually implement all the power of Hazel. There is just too much to write an official manual...

I was thinking about this because the Subfolder rule is one of the most mis-used and misunderstood rules and i was going to do a write up of best practice with examples of how to use it (just fully comprehending it the other day despite using for awhile).

Love your input Mr Noodle and certainly would volunteer to help in any way I can with it if you need it.
dhy8386
 
Posts: 94
Joined: Tue Nov 09, 2010 12:19 pm

Re: Hazel "Best Practices" thread Mon Dec 13, 2010 12:57 pm • by gcoghill
I agree, often I will post as question or a tip only to find it was a reply somewhere else in the forums.
gcoghill
 
Posts: 266
Joined: Tue Sep 18, 2007 8:09 am
Location: Kent, OH

Re: Hazel "Best Practices" thread Wed Dec 15, 2010 3:25 pm • by Mr_Noodle
I'll ponder the wiki idea. When 3.0 goes into beta, I may have a bit more time to deal with things like this.

As for the subfolder thing, I did sticky the article at the top of the forum though it seems that it gets missed at times. In the shorter term, maybe I need to muck with the bulletin board software's formatting so that sticky articles maybe show up in 200pt text and have flashing arrows.
Mr_Noodle
Site Admin
 
Posts: 7933
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Hazel "Best Practices" thread Wed Dec 15, 2010 6:42 pm • by sjk
If you could add a "print view" for topics during your forum software mucking it would be much appreciated. For example, what clicking the printer icon near the top-right corner does: here. Thanks!
sjk
 
Posts: 332
Joined: Thu Aug 02, 2007 5:43 pm
Location: Eugene

Re: Giving a Folder Some Time Mon Feb 14, 2011 3:06 pm • by ReactiveLight
gcoghill wrote:Giving a Folder Some Time
To process only files created Today, but not process them immediately, add two "Date Added" rules:

• Date Added is Today
• Date Added is not in the last XX hours


I'm trying to convince Hazel to wait until OS X's AutoImporter has finished bringing in all the images from my camera before it starts sorting them into subfolders. Following the suggestion above, I added:

Date Added - is not in the last - 3 - minutes

...to my conditions for the sort function. It did indeed stop Hazel from moving them before the import was finished. However, Hazel never came back to do the move (not within 30 minutes, anyway). The images only got moved after I manually selected Run Rules on the import folder. Any suggestions?

Actually, what I'd really like would be for Hazel to recognize that AutoImporter is running, and not touch its target folder until it quit (which it does automatically after the import). If it can't figure out where the target folder is, then just completely pause while AutoImporter is open.

Best of all would be to have the option of creating a list of applications that would pause Hazel while they were open.
ReactiveLight
 
Posts: 3
Joined: Mon Feb 14, 2011 1:47 pm

Re: Giving a Folder Some Time Tue Feb 15, 2011 4:21 am • by gcoghill
ReactiveLight wrote:
gcoghill wrote:Giving a Folder Some Time
To process only files created Today, but not process them immediately, add two "Date Added" rules:

• Date Added is Today
• Date Added is not in the last XX hours


I'm trying to convince Hazel to wait until OS X's AutoImporter has finished bringing in all the images from my camera before it starts sorting them into subfolders. Following the suggestion above, I added:

Date Added - is not in the last - 3 - minutes

...to my conditions for the sort function. It did indeed stop Hazel from moving them before the import was finished. However, Hazel never came back to do the move (not within 30 minutes, anyway). The images only got moved after I manually selected Run Rules on the import folder. Any suggestions?

Actually, what I'd really like would be for Hazel to recognize that AutoImporter is running, and not touch its target folder until it quit (which it does automatically after the import). If it can't figure out where the target folder is, then just completely pause while AutoImporter is open.

Best of all would be to have the option of creating a list of applications that would pause Hazel while they were open.


You might try "Date Last Modified Is Not In The Last…", but not sure why Hazel isn't rescanning your files unless you have a logic error in other rules or the parent folder rules. Also, not sure if the "Today" timeframe is the actual same date, or the past 24 hours. Any chance you ran things around midnight?
gcoghill
 
Posts: 266
Joined: Tue Sep 18, 2007 8:09 am
Location: Kent, OH

Re: Giving a Folder Some Time Tue Feb 15, 2011 8:00 am • by ReactiveLight
gcoghill wrote:Giving a Folder Some Time
You might try "Date Last Modified Is Not In The Last…", but not sure why Hazel isn't rescanning your files unless you have a logic error in other rules or the parent folder rules. Also, not sure if the "Today" timeframe is the actual same date, or the past 24 hours. Any chance you ran things around midnight?

Not a time of day issue (it was mid-afternoon), and not a logic issue. The rules run fine if "Date Added is not in the last 3 minutes" isn't present, and if it is there the rules still run correctly if done manually. Perhaps I wasn't patient enough, but it defeats the purpose of my sorting system to have to wait a long time for Hazel to rescan the files.

Mr. Noodle (if you're reading this), is it too much to ask to add the ability to pause Hazel while specified apps (like AutoImporter) are open? I can imagine lots of circumstances where this would be useful. I understand that you might be concerned that folks would think Hazel had stopped working when it was actually just paused by some forgotten program, but it seems to me that the benefits outweigh the risks.
ReactiveLight
 
Posts: 3
Joined: Mon Feb 14, 2011 1:47 pm

Re: Hazel "Best Practices" thread Fri Feb 18, 2011 4:56 pm • by Mr_Noodle
I think pausing Hazel when apps are running is a bit heavy handed and I believe it would create more problems than it would solve.

I suggest you check the logs to see what happened. For one, it's important to check to make sure Hazel was running at all after the first run when the import happened. Also, more details on what kind of folder is being imported into would help. Is this folder on your main drive? On an external drive? On a USB drive?

Lastly, I suggest you reply in the Support thread. It doesn't seem relevant to this thread or forum.
Mr_Noodle
Site Admin
 
Posts: 7933
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Next

Return to Tips & Tricks - DO NOT POST QUESTIONS