A few months ago, Apple’s Music app decided I needed to back up my music. At least, that’s what I’m assuming happened. Somehow, by some act of God, my music library was populated with a duplicate file of every song in my collection. We’re talking hundreds of gigabytes, here, filled with absolute junk. Every folder went something like this:

Anna Burch: Quit the Curse

2 Cool 2 Care.flac, 2 Cool 2 Care 1.flac, Tea-Soaked Letter.flac, Tea-Soaked Letter 1.flac

…on and on, for **thousands upon thousands** of files.

For a ton of obvious reasons, this broke my brain. Once I set aside questions of why and how, and after deleting the Music app, I was left with hundreds of gigabytes of mess. On top of that, I’m itching to integrate my father’s collection of music into my own– but it’s useless to try and organize a mess like that.

Enter Hazel, a powerful piece of file and folder automation software that solved my headaches. The solution to my problem was as simple as a few smart rules in Hazel, and I was done. I wrote a rule that searched every file within my music library, and isolated files that ended in “_1” (without quotes, obviously, and this example utilizes an underscore instead of a space). From there, I wrote another rule that created a subfolder within the file’s location named “Duplicate Files” and automatically sorted each duplicate into that subfolder. Then one more rule searched the library for all folders with the name “Duplicate Files” and moved them all out of the music library into one top-level folder for my review.

I thought about writing the rule so as to command Hazel to delete each duplicate, but I realized in a moment of (possible) genius that one downside of that rule would be automatically removing any song names that organically end in “_1”. I don’t think too many songs would match that rule, but for all I know I’ve got some demo take from a Bill Evans record titled “My Funny Valentine Take 1” that would get obliterated by automated deletion. Moving everything into a special quarantine zone worked for my brain.

This has my brain absolutely spinning. I could automate so many things with Hazel!