Can Hazel compare file names for sorting?

Talk, speculate, discuss, pontificate. As long as it pertains to Hazel.

Moderators: Mr_Noodle, Moderators

Can Hazel compare file names for sorting? Sun Mar 19, 2017 11:51 pm • by Beto
Hi, I'm trying to organize my fonts into a folder named as the family. I'm using Fontcase app as font manager and this app has the library folder sorted alphabetically, I only see the font families grouped through the app, so I can then drag a family out to the finder and I will have only the files from said family.

So if I drag, for example the family Helvetica in the Finder I can see:

Helvetica Book.otf
Helvetica Light.otf
Helvetica Bold.otf
Helvetica Heavy.otf

I want to sort these files to a folder named Helvetica. You might says it's as easy as creating a rule "file starts with Helvetica" but this is where my question gets tricky:

I'm trying to make a rule that works for ALL of the font family names, but not at the same time, this is.. I'll be dragging out just 1 font family at a time, and would like Hazel to take those files and group them in a folder with the same COMMON name of the files.

So if I drag

Helvetica Book.otf
Helvetica Light.otf
Helvetica Bold.otf
Helvetica Heavy.otf

I want the rule to save the common name in the files, which is Helvetica and sort those files into a folder name Helvetica.

Then I drag out the next family:

Arial Book.otf
Arial Light.otf
Arial Bold.otf
Arial Heavy.otf

The rule gets the common name in the files, which is Arial and sorts those files into a folder named Arial.

Then I drag out the next family:

Freight Sans Pro Book.otf
Freight Sans Pro Light Italic.otf
Freight Sans Prol Bold.otf
Freight Sans Prol Bold Italic.otf


The rule gets the common name in the files, which is "Freight Sans Pro" and sorts those files into a folder named "Freight Sans Pro"


Is this possible?
Beto
 
Posts: 1
Joined: Sun Mar 19, 2017 11:27 pm

Re: Can Hazel compare file names for sorting? Mon Mar 20, 2017 12:08 pm • by Mr_Noodle
It depends. First off, look up "match patterns" in the help. You'll need to create a custom attribute to grab the family name.

Now, figuring out which part is the family is a bit tricky. It might be best just to have separate conditions to match against all the possible font weights that might show up. For example: "(• family name) Bold". A bit tedious but better than hardcoding all the family names.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Open Discussion

cron