Renaming and/or moving folders by first file in it

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

Moderator: Mr_Noodle

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.
dhlavaty
 
Posts: 2
Joined: Mon Feb 17, 2014 2:44 pm

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.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

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.
dhlavaty
 
Posts: 2
Joined: Mon Feb 17, 2014 2:44 pm


Return to Support