In this episode, David and Katie talk about how to keep your Mac clean and organized using Noodlesoft’s Hazel. Hazel watches folders and runs actions based on specific criteria to take action on the folder items. Hazel also keeps your Mac tidy by throwing away left-over bits of deleted programs and helping you to manage your trash.
Links of note
Hazel
MacSparky: Sorting and Moving Documents
MacSparky: Magic Install Disk Screencast
ScreenCastsOnline: Housekeeping with Hazel
Add to Things via Dropbox and Hazel
PassPORT iPhone Charging Adapter
Use Discount Code MPU25 to save 20% off the purchase price of Hazel. The discount expires May 3 and can be found here. Valid for one week after the show is published.
Please support our sponsors:
Save 20% off the price of 1Password using coupon code MacPowerUsers or through this link:https://agilewebsolutions.com/store?d=MacPowerUsers
Correction: The Fuze $25 iTunes card requires that you sign up at FuzeMeeting.com/Mac, not just fuzemeeting.com as mentioned in the show.
Podcast: Play in new window | Download (34.9MB)




A possible reason to partition a drive. While I wouldn’t partition my main drive, for larger external drives, I partition them so that I have a drive the same size as my internal drive for SuperDuper! backups and I’ll use the remaining space for other reasons (e.g., copies of the install files). I don’t recommend putting the Time Machine backup on that partition since you’re putting all your backups on one drive, but you could if that’s the only option.
In my case, I have one drive partition like that and another partitioned that has Time Machine backups on one partition and media files on another. I backup the media partition via Backblaze.
Now I finally get Hazel. I had stared at the homepage a couple of times and just thought “…What?”. Hearing examples helped. Also, congrats on the sponsorship.
And thanks for mentioning me twice! It was a nice birthday surprise. The MyWi (share iphone 3G via USB/Bluetooth/Hotspot) tip was me
Great episode. I got into Hazel mostly because your Backup podcast freaked the hell out of me. I was about 70,000 words into the second draft of a novel when I realized that I could be screwed if my hard drive crashed or my laptop was stolen. So I spent one Saturday working on a backup system to make sure I’d be insured if something happened. I’m still running on Tiger and don’t have Time Machine so I use some Hazel rules to back up my novel project obsessively. I have one rule that makes a backup and archives the Scrivener file I’m working on about every 15minutes AS I’M WRITING. So if something terrible happens I can go back to an archived copy.
I wrote all about it on my blog and if you go there you can see a picture of what my Hazel workflow looks like:
http://deathandhousekeeping.com/foolproof-backup-system.html
Thanks again for the great show. The geekyness was at 11.
Okay ordered Hazel based on your show’s recommendation and usage examples. First thing I did was set up a rule to move license file from Download to a license folder on my Dropbox.
Been wanting to get Hazel after listening to your first work flows episode. Thanks for the 20% discount!
Also a big thanks for a great Hazel geek out explanation. Using Hazel with Dropbox is going to give me a HUGE home(mac)/work(pc) work flow performance boost. Score!
Kudos!
Boot camp requires you to partition your internal hard drive.
Hi, I’m a new listener (I’ve been listen to your podcast since episode 22) and I’am loving it.
I’ve just listen this episode and as soon as I get home will install Hazel on my Mac to improve my pictures workflow. I’ve written an application that organizes pictures for me based on EXIF tags (moving them to folders AAAA_MM_DD). I want to try something like this using Hazel.
Otavio:
I’m trying to do this too. Hazel would be perfect if it could read EXIF data, but it doesn’t seem to do so. Until it does, I’ve been using a little donation-ware program called EXIFRenamer, available here:
http://www.qdev.de/?location=mac/exifrenamer
I drop all of my photos into a folder on my harddrive, then drag them onto EXIFRenamer. The program renames the files in a variety of styles (I use YYYY-MM-DD), and you have the option of then moving them to a new folder. I move them to a folder that is watched by HAZEL, which then sorts them into subfolders, and shuttles them around for me.
This is particularly useful for me with images coming off of my iPhone. I do photos, videos and screenshots on the iPhone, but I like to keep these files separated. Hazel is great at sorting JPGs that I shot with the camera and keeping them separated from PNGs that are screen captures.
I’m new to this podcast and am rapidly catching up on my listening. Fantastic job, Katie and David!
have been using Hazel for almost a year now, and thought I would share with you one of my, quite specific, but very useful workflows for using Hazel with Dropbox shared folders. I do a lot of collaborative work with many different people and make great use of the shared folders feature of Dropbox. However, if a colleague or client places a new file in a shared folder, or modifies an existing one, I have no way of knowing this, unless I go in manually and have a look, or get sent an e-mail to let me know. To combat this issue I created the following Hazel rule:
IMAGE: http://bit.ly/aMI76Y
As you can see, any file within one of my Dropbox shared folders that gets created or modified, will have an Alias placed onto my desktop, and this will also be coloured yellow (I use the colour yellow only for this, so that I can quickly identify items that have matched the rule.
Another great episode, guys. As I’ve said before, these software companies must love you because people like me buy the software so quickly after hearing your practical explanation of it.
I’ve been listening to MPU since the very beginning, and the thing that consistently strikes me the most about your podcasts is that I don’t feel like I absolutely *need* to be in front of my Mac to understand the concepts you’re conveying. That’s a gift you have. It’s not shared by all podcasters, I assure you.
Thanks again for making my workflow a little bit better and getting us great discounts on such awesome software. Cheers.
Does anyone know of a way to only keep say the two most recent backup copies of a file with Hazel and delete the rest?
Backups are in the format yyyy-mm-dd-Documents Library Backup.Zip
I figure to only keep the 2 most recent ones.
Thanks
Been playing around with Hazel today. I’m already in love with it. I just set up a rule to secure delete any Quicken QFX files as soon as they hit my download folder. I started using Quicken Essentials for Mac earlier this year, and I don’t think I even realized that I had been accumulating these QFX files in my Downloads folder. They contain account numbers, bank names, etc. Now, I just let Hazel zap them the immediately with a simple shell script:
srm -frm $1
Just having this little bit of added security is worth the price of Hazel probably 10x over.
Another reason to partition a drive is performance. Granted, most drives coming with a mac are small to begin with, but you can improve your speed significantly by partitioning the drive in half. Place all the information you use constantly on the first half of the drive (or 1/4 of the drive if you can manage it) to improve your read and write speeds. You can use the rest of the drive for archive data that you reference and write to rarely. Note if you write to the second partition frequently, you’ve degraded your performance, so use it only for archiving purposes. You can find descriptions of why this is by in articles like this http://blogs.zdnet.com/Ou/?p=322.
I have a Mac Pro and have done this with each of my drives. Of course YMMV, especially if the drives are too small to be useful once divided in half.
And the macperformance guy talks about raid0 with only the outer partitions of his drives to squeeze every last bit of speed…. Well, he used to. Now he just uses solid state drives (a lot less headache).
Hi there,
as always, you made an awesome Podcast – thanks for that.
I tested Hazel while the Podcast was playing and bought it even before the Podcast was over
Keep on the great work!
Here’s some applescript code I wrote this evening to use in a Hazel script, monitoring for a file whose name begins with “proc_xxx”.
The script does two things:
1) Adds OpenMeta tags
2) Renames the file with a PREFIX and the current date formatted YYYYMMDD
Notes:
a) You must install the openmeta command line interface see: http://code.google.com/p/openmeta/
a) Hazel doesn’t like applescript functions (ex. on funcName()), so all code has been written in-line
Hope this helps.
– MODIFY: DEFINE PREFIX
set prefix to “xxx”
– MODIFY: DEFINE TAGS
set tags to {“tag1″, “\”tag 2 with spaces\”"}
– EXTRACT FILE NAME
set posixPath to POSIX path of theFile
set text item delimiters to “/”
set oldFileName to last item of text items of posixPath
– BUILD: OPENMETA COMMAND
set ex_script to “openmeta -a ”
repeat with tag in tags
set ex_script to (ex_script & tag & ” “)
end repeat
set ex_script to (ex_script & “-p ” & posixPath)
– BUILD DATE
set cd to current date
set myYear to year of cd
set myDay to (day of cd) as string
repeat while length of myDay < 2
set myDay to (“0″ & myDay)
end repeat
set myMonth to (item 1 of text items of short date string of cd) as string
repeat while length of myMonth < 2
set myMonth to (“0″ & myMonth)
end repeat
set dateName to (myYear as string) & (myMonth as string) & (myDay as string)
set text item delimiters to “.”
set nameParts to text items of oldFileName
set extension to last item of nameParts
set newFileName to prefix & “_” & dateName & ¬
“.” & extension
set text item delimiters to “/”
do shell script ex_script
tell application “Finder”
set name of theFile to newFileName
end tell
@Tom
(re http://macpowerusers.com/2010/04/mpu-025-geeking-out-with-hazel/comment-page-1/#comment-404)
Brilliant! Thanks for the tip.
I wouldn’t clean up my 1Password backups on Dropbox with Hazel. 1Password gives you the opportunity in the preferences to define how many backups you want to keep.
I can’t find the applescript that you use in your workflow to ocr pdfs with PDFpen. Do you have a link to that?
Absolutely brilliant episode – I have had hazel on my machine for ages but never took the time to see what it did.
Already set up some schedules and probably lots more to come.
Thanks David & Katie – not the first time you’ve taught me new things – keep up the good work
Learned of your podcast from the Merlin episode… have now listened to most of the back episodes and have learned quite a few cool new tricks. Can’t wait for more. Have you considered a command line episode… I know its a bit scary for the average Mac User, but I think “powerusers” would appreciate knowing some basic command line tricks Unix/Linux users take for granted.
Did some Hazel+dropbox integration between my 3 Macs. Created one folder that is watched by each Mac so I can drop from any machine to that folder and have automation kick off on the remote machine – no VPN, no muss no fuss.
One of the really nice ones is to drop a download link and have my machine at home download the file so its there when I get home.
I’m new to the fine points of Hazel, but I’m catching on fast. Thanks so much David & Katie!
Here is a nice little rule I wrote:
Problem to be solved:
When I do a screen shot with ‘?-Shift-4’ I get a .png file in my desktop with a name like this:
Screen shot 2010-03-02 at 10.23.57 AM.png
Before I would normally use the file, I’d convert to .jpg and rename it. While this doesn’t take much time,
it can be automated.
Solution:
Add the Desktop directory to list of directories that Hazel watches.
Make a Screen Shot directory in Desktop
Make Automator workflow:
1) Find the file in finder
2) Rename the file with a dialog box
You may need to download automator action “Rename Finder Item” from
http://automatoractions.com/files/renamefinderitem1.0.html
3) Change file type (from .png to .jpg)
Then, Create a 3-step Hazel Rule:
1) Move the file to the Screen shot directory
2) Run Automator workflow (described above)
3) Send Growl notification
Usage:
Snap Screen Shot with (?-Shift-4)
Wait a second until the dialog box appears
Enter the file name (example.jpg)
Clear the Growl notification
Find the file in the Screen shot directory
Great show. Just bought it.
25 top-quality shows. I love the dialogues, the exchange of ideas, the no-nonsense, the idea of covering just one topic in depth, the no hesitation to dwell into obscure workflow ideas that *do* work wonder, and the fact that you both use and discuss Macs for work. Thanks a ton!!!
i’ve missed the Discount Time on Hazel. Do you think it can be extended, so people, listening to this podcast later, can get the discount too?
Thank you very much for so many great episodes of Mac Power Users!
Steffen
Andrew,
For saving work I use Worksaver. This is for iwork but it will save documents as you are working on them every X minutes. It is free as well!
Katie,
I agree with you here about how Neatworks has failed me. I have been trying and trying to use it but there is not enough tools here. They just brought out version 3 and I cannot see any changes!
I think that I am taking my documents out of this and using the nested folders approach.
My ultimate solution that I have not found yet is to snap a picture of a receipt with my iphone and be kept in a neatworks or similar db.
Anyone?
I thought your Geeking out with Hazel episode was great. One thing I always do when creating a new Hazel rule Is add a check of the file’s label color at the beginning. That is, the rule only executes if the file isn’t labeled with a color. Basically it keeps Hazel from acting on that file if it’s labeled. That way if I don’t want Hazel to process that file for whatever reason at that point and time, it won’t. I don’t have to turn off the rule, turn off Hazel, or mess with my workflow at all, just to keep it from processing whatever rule on a given file. Later on if I want it to, usually removing the label will do the trick and the rule will run on that file. I realize that’s probably Hazel 101 and something everybody does, but I also know that I think different than 95% of the world too.
Of course, the above can’t be applied if you’re using labels in your rule for other processing.
[...] Mac Power User Podcast spotlight on Hazel – truly worth a listen: MPU25 [...]
I’m late to the comments but I too loved the episode enough I bought Hazel and am loving it. I had looked at it before but though “HUH?”. Your ‘cast explained things so well I just had to have the tool and it is already making a difference in my workflows. Thanks for the time and energy (and the discount!) you put in to helping us all. That’s why the Mac community is the best!
Totally digging the podcast. The whole workflow management thing can certainly become a struggle when things get busy. It took me a whole of 15 minutes to trying Hazel and realizing I totally need this. Really helps not working about all the other applications you use and not worrying about each one’s preferences for downloading things.
Another Hazel security tip. . .
I just used Eric’s color label concept to make a Downloads folder rule that securely deletes files that I mark with a gray label.
About once a month, I download financial statements as PDF files, and they land in my Downloads folder before I move them to a secure disk image. The files have account numbers that I don’t want available to just anyone.
Rather than manually zapping them using Terminal, I created a Hazel rule that runs a simple shell script on any gray files less than a minute old:
srm -frm $1
Works great.
Great idea Eddie. Have you ever seen a time it didn’t work? There are times that Hazel seems to hang a bit and the rules take much longer to run than other times. I’m guessing it has to do with CPU usage but in either case, is it possible such a rule could miss the ‘window of opportunity’? I’ll have to incorporate the idea though to secure-delete based on labels.
@Deverill, I have on occasion seen Hazel miss something, but not with this particular situation. It happens rarely, but only when I’m putting the pedal to the floor and asking Hazel to act frequently (e.g. editing a text file and having Hazel process the text file frequently). I’ve gotten away from this practice recently, though.
I’m in my Downloads folder routinely, so I think I would notice a gray-colored file that was hanging around too long. Also, I have the rule set up to give me a Growl notification whenever it zaps a gray file.
Another strategy I’ve contemplated is setting up a dedicated “secure delete” folder and putting a shortcut to it in my Finder sidebar. I could set up Hazel to immediately zap any file I move to that file. I may do this at some point, but I find that I don’t have to secure delete very often.
If you come up with a more creative approach, let me know.
I have two favourites. One is a shell script which mounts DMG’s in the background and automatically accepts EULA’s.
#!/bin/shfile="$1"
extension=${file##*.}
if [[ $extension == "dmg" ]]; then
echo "yes" | hdiutil attach "$1"
fi
The other one is a set of rules which I use to automatically move projects from my actions folder to one another. I use tags (Spotlight comments: &pending, &waitFor, &junk) to determine whether a file should go into ~/Current/1 – pending or ~/Current/4 – junk (or 2 procrastinate or 3 idea). When I change the tag of a file from, let’s say &pending to &junk. Hazel moves that folder automatically to 4 – junk.
Took me a while to figure that out, but now it’s working ubercool.
http://dl.dropbox.com/u/6102/tmp/hazel_rules.zip
(If you have a place to upload this I would appreciate it since I will delet this zip sometime soon)
[...] Hazel: Hazel is a mac housekeeping app. It watches folder and performs clean up tasks based on rules you set. It’s really great. Listen to the incredible Mac Power User’s podcast describing the app here. [...]
Bob Proctor up at April 30 goes through a long process to rename png screenshots.
Tinkertool provides a simple way to do that. With TinkerTool it is possible to set what graphic format is saved AND to specify a folder for the save AND to specify a naming convention.
I have set my screenshots to save as gif simply to save file size, and put them all in a folder in documents called * Image Saves
It would be easy to have Hazel monitor that folder . . .
[...] articles, bank statements, boarding passes and other content. Hazel is extensively discussed in this episode of [...]
Aleg Chirp,s July 12 post above is right on. My must have list would add two utilities [Mail Tags and Mail Act-On] and one program [SuperDuper]. Won’t be upgrading to Lion until these three apps and Aleg’s 5 are Lion certified plus, I might add my Scansnap driver and Okiedata print driver. I’ve just dumped Quicken 2007 and moved to iBank so Intuit’s mighty screwup is no longer an issue for me as relates to timing of my Lion upgrade.
I just found another webpage that has some very interesting uses for Hazel.
They include:
1. Remove Unused Apps
2. Archive Older, Larger Files
3. Auto-add PDFs to Evernote
4. Automatically Start Amazon MP3 Downloads
5. Synchronize iChat Logs with Dropbox
6. Keep Your Desktop Clean
7. Automatically Import Downloaded Photos into iPhoto
http://www.maclife.com/article/features/7_awesome_hazel_rules_you_cant_live_without