Moving Files whose Name Partly Matches Folder Name

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Hej

So I been trying to fix the last part of my media storing for the past month now with no success with Hazel,

Currently I have everything set up that once a file is encoded it will be meta tagged and tagged for OSX and then moved to a NAS drive for storage,

However the broken link is moving TV shows to the correct folder

So for example I have Sons of Anarchy S02E01 Etc.m4v

and i would like to move the the Sons of Anarchy Folder

I assume that it would be something along the lines of

Subfolder Depth = 0 (so that it doesnt move anything already in folders,
Move to folder that matches filename until (space)S ,Since all my shows are named correctly it will be the common rule that should move the file to Sons of Anarchy folder

Example Image
Image

I just cant seem to be able to make Hazel do this,

I have even thought about if filename matches first 3 characters of folder move to folder but still no joy

Any Ideas?

Thanks!
GBDS
 
Posts: 5
Joined: Mon Oct 12, 2015 4:01 am

Have you looked at match patterns? If not search the help as they should allow you to do what you want here.
Mr_Noodle
Site Admin
 
Posts: 11872
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Finally It Works, I swear I Looked at this before but after a good hour this morning it finally works!

Im not sure if it was hard to understand or if I was just being super dumb but it actually took a bit of effort on my part, But once the way to construct patterns was clear in my head then it all made sense,

I shall do a quick walk through below just in case it helps in the future,

So as you can see from my First Post my Tv Shows are Named as follows

Show Title SXXEXX Episode Title.m4v

E.g.> Sons of Anarchy S02E04 Eureka.m4v

So What I understood from reading the help was to create a *custom token* for each attribute,

This is done via setting a rule for If Name Matches, Once you click in the text box next to this it opens with the following
Image

Next Select Custom Text

Image

Now we will create the *custom token* for each attribute

I have split them into 3 attributes required for what I need

1) Show Title - Eg. Sons of Anarchy

So in the Name, you can call it what you want, I have kept Show Title so I can understand later, And then in the box below the element to add is *anything*
Image
This will allow the rule to run for non-specific TV Shows

2) Episode ID - Eg. S02E04

So in the Name, you can call it what you want, I have kept *Episode ID* so I can understand later, And then in the box below the element to add is different that above,

I have Gone with S Number Number E Number Number
Image
This way if a TV show has a title with more than one word and not the first word starts with S it wont get confused.

3) Episode Title - Eg. Eureka

So in the Name, you can call it what you want, I have kept Episode Title so I can understand later, And then in the box below the element to add is *anything*

Image


So Now your Pattern should look like this
Image

Note that I have highlighted the 2 spaces which I use to separate the items in the file names, If you use a . then change the spaces for .

Next in The *Do the Following to the matched file or folder* add the actions you want

So for me its *Sort into Subfolder* The select the Pattern Show Title (show in the image)

Image

And that's all you need,

Hope this helps anyone who needs it
GBDS
 
Posts: 5
Joined: Mon Oct 12, 2015 4:01 am

Glad it finally clicked for you and you got it working. And thanks for the detailed and illustrated post.
Mr_Noodle
Site Admin
 
Posts: 11872
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support