Page 1 of 1

Tagging based on filename

PostPosted: Wed Mar 21, 2018 12:31 am
by thebookbloke
Hi

Here's a couple of my file names:

Cricks, Jane - 1881 Census Schedule.jpg

Allin, Francis - 1835 Baptism Register.png

I might want the file to carry three tags: the surname (Cricks or Allin), the type of document (Census or Baptism), and the date (1881 or 1835).

Can I use Hazel to extract strings from the filename and use them as Finder tags? It'd be great if I could because I have thousands of these files and will accumulate more pretty regularly.

Cheers

Mick

Re: Tagging based on filename

PostPosted: Wed Mar 21, 2018 10:53 am
by Mr_Noodle
Check out "match patterns" (search for them in the help). You can create custom attributes to grab the text you want. Then, in the "Add tags" action, you can create a dynamic tag to insert those back in.

Re: Tagging based on filename

PostPosted: Thu Mar 22, 2018 12:39 am
by thebookbloke
Thanks. That seems to be the way forward. Have had success with most files. The exceptions have had names with an inconsistent file name structure. I can fix that.

Great stuff.