Sort into sub-folders help please

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

Moderator: Mr_Noodle

Sort into sub-folders help please Wed Jun 28, 2017 1:41 am • by Allsop
I have a folder which contains photograph files sorted into sub-folders by year, e.g. 2013, 2014 etc., the files are named with this pattern YY-MM-DD_####.jpg (the date is the date that the file was created). I am trying to write a rule that sorts these files into sub-folders by month so that the name of the sub-folder would be YY-MM and I am getting into all kinds of a mess! I just can not seem to work out how to do it but I think there must be a simple way! Can any kind soul hep me please? many thanks.
Allsop
 
Posts: 67
Joined: Thu May 01, 2014 1:43 am

Re: Sort into sub-folders help please Wed Jun 28, 2017 10:45 am • by Mr_Noodle
If the files are already in subfolders, then you need to have Hazel go into subfolders to get at them. Search the help for "subfolders" on how to do that.

From there, you can use a custom date attribute (search the help for that if you don't know what that is) to match the date in the name. Once you have that, you can re-sort the file into a subfolder based on that custom date attribute. When using the date in the Sort pattern, you can click on it to edit the format. There, you can specify it only use the year and month.
Mr_Noodle
Site Admin
 
Posts: 11872
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Sort into sub-folders help please Wed Jun 28, 2017 2:31 pm • by Allsop
Thank you for this, but I am still having problems even when I have done as you suggested, (I think!).

My folder pattern is:

Processed>Year>Files (each with name pattern YY-MM-DD_####)

I want to move the Files into sub-folders reflecting the month so I end up with a folder pattern of:

Processed>Year>MM>Files (each with name pattern YY-MM-DD_####)

(The object is to get Hazel to go into the year subfolders and sort the contents into monthly subfolders. So it might be easier to run a rule on the individual yearly folders)

I have, following your advice, created a Hazel workflow as follows:

Name: Go into subfolders
If All of the following conditions are met
Kind is folder
Do the following to the matched file or folder:
Run rules n matched folder contents
Sort into subfolder with pattern date created (with edited pattern YYYY - MM)

Running this I get:

Processed>YYYY-#>Year>Files (each with name pattern YY-MM-DD_####)

(I do not know what the # is after the first YYYY)

This is obviously not what I want!
Allsop
 
Posts: 67
Joined: Thu May 01, 2014 1:43 am

Re: Sort into sub-folders help please Thu Jun 29, 2017 10:31 am • by Mr_Noodle
Check the manual on subfolders again. You are combining rules where you shouldn't be. There should be a separate rule to match folders and one to match the files you want to sort.
Mr_Noodle
Site Admin
 
Posts: 11872
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support