Page 1 of 1

Renaming and/or moving folders by first file in it

PostPosted: Mon Feb 17, 2014 3:02 pm
by dhlavaty
When I export Events from iPhoto, it creates structure like this:

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.

Re: Renaming and/or moving folders by first file in it

PostPosted: Tue Feb 18, 2014 4:55 pm
by Mr_Noodle
I don't think there's a way to do this without a script, currently. I think the missing piece is that you can only use match patterns on text, not date attributes. So, there's no way to capture the date of a file, then re-use that when renaming the containing folder, for instance.

Re: Renaming and/or moving folders by first file in it

PostPosted: Wed Feb 19, 2014 8:19 am
by dhlavaty
Is there any good angel who can help me with such a script ?


Mr_Noodle wrote:I don't think there's a way to do this without a script, currently. I think the missing piece is that you can only use match patterns on text, not date attributes. So, there's no way to capture the date of a file, then re-use that when renaming the containing folder, for instance.