Page 1 of 1
Sort into subfolder by date

Posted:
Sat Apr 02, 2016 1:03 pm
by MandoDan
I am trying to sort my files into subfolders by date. I am having trouble.
I scan and OCR my files. Hazel reads the date (as a ‘’contents-contains match – custom date’) from the scanned file and uses it in the name of the file.
If file contents contains match – custom date –
Then rename ‘custom date’ words words ‘extension’
I want to then use the year from the custom date to use to sort into a subfolder of that year.
The problem is, is doesn’t work – sometimes. So files from the year 2013 get sorted into a newly created folder ‘2020’ or ‘2094’. Other times, 2015 is sorted correctly.
Thoughts anyone?
Re: Sort into subfolder by date

Posted:
Mon Apr 04, 2016 10:52 am
by Mr_Noodle
What version of Hazel are you running? If not 3.3.7, make sure you update to that.
By chance, are your date settings set to a non-US region?
Re: Sort into subfolder by date

Posted:
Tue Apr 12, 2016 11:09 pm
by MandoDan
Mr._Noodlesoft
Thanks so much.
I am using 3.3.7 and my dates are US - PST region.
And still, the dates are giving me trouble
Re: Sort into subfolder by date

Posted:
Wed Apr 13, 2016 8:59 am
by Mr_Noodle
Can you email in to support (click on "Contact Support" in Hazel's "Info" section) and attach the rule and an example file that demonstrates the problem?
Re: Sort into subfolder by date

Posted:
Sat May 07, 2016 11:38 am
by MichaelTzu
If this has been resolved can I have a copy of the rule to study as stuck myself with similar.
Re: Sort into subfolder by date

Posted:
Mon May 09, 2016 10:33 am
by Mr_Noodle
I suggest posting your specific details as it may be different. A lot of times, though, it's people trying to match a 2 digit year against something like 2016 (where the two digits end up matching "20").
Re: Sort into subfolder by date

Posted:
Tue Jan 17, 2017 11:02 pm
by Rhys
Hi, I am having this issue also Hazel 4.0.8 is changing the 'modified date' & 'Last Opened date' I am matching a four digit year and a two digit month.
My rule is
Takes my files from my folderA
if [any]
[kind] is [Image]
[kind] is [Movie]
Do the Following
[Move] to folder [folderB] (Options:Rename the file)
[Sort into folder] with pattern [date created] year(1999) (Options:Rename the file)
[Sort into folder] with pattern [date created] month(12) (Options:Rename the file + Throw away if duplicate)
If i process Duplicate files, from folderA, again then also it changed the 'Created Date' and places the file into a folder that is not from the creation date.
Logs of one file, first and second pass:
2012-07-13 at 10-06-22.jpg: Rule Move and Sort Photos+Movie by Year+Month matched.
[File Event] File moved: 2012-07-13 at 10-06-22.jpg moved from folder /Users/User/Pictures/Masters to Import/100MSDCF to folder /Users/User/Pictures/Sorted.
[File Event] File moved into subfolder: /Users/User/Pictures/Sorted/2012/2012-07-13 at 10-06-22.jpg sorted from folder /Users/User/Pictures/Sorted to subfolder 2012.
[File Event] File moved into subfolder: /Users/User/Pictures/Sorted/2012/07/2012-07-13 at 10-06-22.jpg sorted from folder /Users/User/Pictures/Sorted/2012 to subfolder 07.
2012-07-13 at 10-06-22.jpg: Rule Move and Sort Photos+Movie by Year+Month matched.
[File Event] File moved: 2012-07-13 at 10-06-22.jpg moved from folder /Users/User/Pictures/Masters to Import/100MSDCF to folder /Users/User/Pictures/Sorted.
[File Event] File moved into subfolder: /Users/User/Pictures/Sorted/2015/2012-07-13 at 10-06-22.jpg sorted from folder /Users/User/Pictures/Sorted to subfolder 2015.
[File Event] File moved into subfolder: /Users/User/Pictures/Sorted/2015/09/2012-07-13 at 10-06-22.jpg sorted from folder /Users/User/Pictures/Sorted/2015 to subfolder 09.
and mdls for each
$ mdls /Users/User/Pictures/Sorted/2012/07/2012-07-13\ at\ 10-06-22.jpg
kMDItemContentCreationDate = 2012-07-13 21:06:22 +0000
kMDItemContentModificationDate = 2015-09-22 18:12:07 +0000
kMDItemDateAdded = 2017-01-18 00:57:21 +0000
kMDItemDisplayName = "2012-07-13 at 10-06-22.jpg"
kMDItemFinderComment = "2012-07-13 at 10-06-22"
kMDItemFSContentChangeDate = 2015-09-22 18:12:07 +0000
kMDItemFSCreationDate = 2012-07-13 21:06:22 +0000
kMDItemFSName = "2012-07-13 at 10-06-22.jpg"
$ mdls /Users/User/Pictures/Sorted/2015/09/2012-07-13\ at\ 10-06-22.jpg
kMDItemContentCreationDate = 2015-09-22 18:12:07 +0000
kMDItemContentModificationDate = 2015-09-22 18:12:07 +0000
kMDItemDateAdded = 2017-01-18 01:15:00 +0000
kMDItemDisplayName = "2012-07-13 at 10-06-22.jpg"
kMDItemFinderComment = "2012-07-13 at 10-06-22"
kMDItemFSContentChangeDate = 2015-09-22 18:12:07 +0000
kMDItemFSCreationDate = 2015-09-22 18:12:07 +0000
kMDItemFSName = "2012-07-13 at 10-06-22.jpg"
What is changing kMDItems if i'm only moving files?
Thanks.
Re: Sort into subfolder by date

Posted:
Wed Jan 18, 2017 1:17 pm
by Mr_Noodle
Are you moving the file across drives? If so, that ends up creating the file at the destination.
Re: Sort into subfolder by date

Posted:
Wed Jan 18, 2017 2:32 pm
by Rhys
Hi,
It's on the same drive and they have the same root tree, it's in the users directory on the same drive as the system.
Thanks.
Re: Sort into subfolder by date

Posted:
Thu Jan 19, 2017 12:17 pm
by Mr_Noodle
What were the creation dates before this?
Re: Sort into subfolder by date

Posted:
Fri Jan 20, 2017 11:56 am
by Rhys
Hi.
So the creation date was 2012-07-13 at 10-06-22 this I know as the original import from camera named the file name.
Thanks.
Re: Sort into subfolder by date

Posted:
Fri Jan 20, 2017 12:41 pm
by Mr_Noodle
I think the issue is that the creation date on the file is when it was imported, not taken. If you want the taken date, search the forums for "exiftool". Unfortunately, the os does not index that date so you'll need a script to extract that. There should be a forum post describing that feature.
EDIT: Actually, just noticed that the date is in the filename. In that case, you can just use a custom date attribute to match against the filename and use that instead.