Doing the oldest would be a bit tricky. First off, read the sticky article on subfolders as you'll need that rule.
From there, create a rule like the following:
- Code: Select all
If (all) match
Extension is jpg
<<< somehow match against date taken and store it in a custom date attribute >>>
(°date taken) is among the 1 least recent
Do
Add tag (°date taken)
That will match the file with the oldest date. There's a big question about how to get that date. If you are talking about the EXIF date taken, you'll need a script to extract that (search the forums) and then export that as a custom token back to Hazel. The rule will set the date as a tag on the file which will be used next.
To handle the folder, you'll need to do something like:
- Code: Select all
If (all) match
If (all) match for (any of its sub-files)
Tags match (° file date)
Do
Rename (° file date)(name)
To get the sub-condition, you need to hold down option while clicking the + button to create a new condition. This rule will match the folder where it has a file with a tag that matches a date (you'll need to create that custom attribute and set its pattern appropriately). Since the date is stored in a custom date attribute, you can then use it in the renaming pattern.
I suggest studying the above carefully instead of just blindly using it. It's quite tricky and it helps to understand how it works.