Renaming and/or moving folders by first file in it

When I export Events from iPhoto, it creates structure like this:
Photos in each event, can have different created or "taken" dates. So for example picture1 was taken on 2014-12-24 and picture2 on 2013-12-25.
I want to create folder structure by first image in each subfolder, so the final output structure should look like this:
Is there any way how to do it with Hazel ? I will appreciate any advice.
- Code: Select all
FirstEventName / picture1.jpg <--- picture taken 2013-12-24
FirstEventName / picture2.jpg <--- picture taken 2013-12-25
FirstEventName / picture3.jpg
SecondEventName / picture4.jpg <--- picture taken 2013-12-27
SecondEventName / picture5.jpg
SecondEventName / picture6.jpg
ThirdEventName / picture7.jpg <--- picture taken 2014-01-20
ThirdEventName / picture8.jpg <--- picture taken 2014-01-29
ThirdEventName / picture9.jpg
Photos in each event, can have different created or "taken" dates. So for example picture1 was taken on 2014-12-24 and picture2 on 2013-12-25.
I want to create folder structure by first image in each subfolder, so the final output structure should look like this:
- Code: Select all
SomeBackupPathOnNASDrive / 2013 / 2013-12-24-FirstEventName / picture1.jpg
SomeBackupPathOnNASDrive / 2013 / 2013-12-24-FirstEventName / picture2.jpg
SomeBackupPathOnNASDrive / 2013 / 2013-12-24-FirstEventName / picture3.jpg
SomeBackupPathOnNASDrive / 2013 / 2013-12-27-SecondEventName / picture4.jpg
SomeBackupPathOnNASDrive / 2013 / 2013-12-27-SecondEventName / picture5.jpg
SomeBackupPathOnNASDrive / 2013 / 2013-12-27-SecondEventName / picture6.jpg
SomeBackupPathOnNASDrive / 2014 / 2014-01-20-ThirdEventName / picture7.jpg
SomeBackupPathOnNASDrive / 2014 / 2014-01-20-ThirdEventName / picture8.jpg
SomeBackupPathOnNASDrive / 2014 / 2014-01-20-ThirdEventName / picture9.jpg
Is there any way how to do it with Hazel ? I will appreciate any advice.