Monday, March 19, 2012

Hazel

A recent update has prompted me to dust off my Hazel rules. I've become steadily more and more impressed with the options this little addition to OSX brings, Hazel tidies things up, does a host of smart jobs around the computer for you, and I've grown to depend on it.

I've developed a very consistent file naming philosophy,  one I've used for a long time.   The principal tools for organisation in my system are not folders or tags, for me, it's all in the name.   What I like about Hazel is that it takes my twenty year long file naming and organizational practice and has it fully automated. And I barely have to think about it.

A couple of things first.   I have folders for file types, rather than projects, inside my Documents folder.  So all my Word, Pages, RTF and TXT files all sit inside a Text Docs folder.   All my spreadsheets in another, all my PDFs in another, all my OPML docs in another, etc.   

I don't use Hazel for files I create (unless I'm goofing off and forget myself, in which case it catches me). It's more for how files arrive from other sources. I've found that there's three folders where this can arise: Mail Downloads. Downloads and the Desktop.

I have a few quick rules which are straightforward:
- Hazel simply sends anything that lands in Mail Downloads straight over to Downloads.
- I have Hazel rules for gathering up any stray files on my setup, in the Home folder, Documents and so on, and pop them on the Desktop.
- I have Hazel ignore folders on the Desktop. If ever I want to keep a file or two temporarily on the Desktop for some reason, I create a folder as I save them and keep them there.

I have Hazel do most of its work on Downloads and the Desktop. What Hazel does is look at these folders, name files found there according to my system, and put them in the correct folder.

If you open up my Text docs folder, you will see a long running list of files, no internal folders.  For me, the folder lies in the name.  I have a set of three letter codes I use for each project I have.  It would be 32A for a film, ITS for College work etc.   It's the first thing I name a file with and is key to my Hazel rules. My earlier blog post explains the logic behind it, it works for me. what can I say. This particular post is how Hazel integrates with that approach. I just had to find a way to inform Hazel, on a file by file basis, which project each file pertained to.

Here's my Spreadsheets rule for the Downloads folder for example. 


PastedGraphic-1

From the top,
1.  I have a rule for each basic file type I typically use, this catches anything vaguely resembling a spreadsheet.
2.  It assigns a Orange label, this rule only affects files I've not created and I like to have a visual reminder of documents I've received rather than created.
3. It makes a request for information, "which project does this relate to?".
4. It runs a simple Automator workflow which does one thing, adds spotlight comments, I always use a Three Letter Acronym to indicate my project and nothing else.
5. It renames the file accordingly:
PastedGraphic-2
- The "comment" is my three letter acronym which designates my project
- followed by the date as I always format it, YY.MM.DD
- followed by DLD, a searchable signal for me that I downloaded the file rather than created it
- followed by the actual name it originally had and the extension. 
6. It then pops it in the Spreadsheets folder.
7. And sends a Growl notification. 

So I may have had a file 'draft budget.xls' emailed to me by my wife. So a personal project.   The first thing that happens is an Automator box pops up and asks 'Which project does it belong to?"  I type PER and press return.  It renames the file  PER 12.03.19 DLD draft budget.xls and pops it in my Spreadsheets folder.  I'm happy.  I have similar rules for text files, outlines, presentations, scripts etc.

I have all the searchability of my existing file naming structure and I've added in the ability to search for documents which arrived on a particular date simply by searching for "YY.MM.DD DLD" no matter which project they were or what kind of filetype it is.

I do hope Hazel at some point offers the ability to prompt for user input, the Automator workflow is very straightforward but a built in option would be nippier I bet. This is the point where if there's a lot of files I simply turn off Hazel until I've got some space to handle the sequence of requests, usually at the end of the day. One of Hazels virtues is that it simply sits there if you don't have it active. Turn it on, everything is cleared up, and you're back, all tickety-boo.

Now I don't have Hazel do everything to everything.  Renaming music and videos would not be a good thing. I have it simply move them into my Music or Movies folder, I'll decide if I want them imported into iTunes later.  I don't want Hazel launching weighty apps like iTunes either.  

There's additional rules in Downloads for Packages, Zips and DMGs which never land on my Desktop. Hazel ignores them for two days and then moves them to an images folder on an attached external hard drive.

I have a folder for stray photographs which it adds to Aperture for me. That's a recent and very welcome feature.

I did consider setting up an Archive rule which would do what I do myself each new year, and back up and archive off older material. But I think I'd like to integrate Devonthink Pro Office into that, and I haven't had a chance to work it through.

Beyond files I'm originally creating, which I simply save with appropriate names in their filetype folder, I haven't had to do any filing or clearing up since adopting Hazel into my workflow.   It runs smoothly in the background collecting downloads and stray files,. gets them named properly and puts them where they should be.  What more would you want from an intelligent assistant.