Sorting photos into albums

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

Moderator: Mr_Noodle

Sorting photos into albums Sun Nov 11, 2012 11:00 am • by haze_l_user
I am new to Hazel and this forum but could not find a solution anywhere for my specific problem - I would really appreciate help on this one!

I have a large number of photos and am trying to sort them into albums, somewhat along the lines of iPhoto events (however, I cannot use iPhoto for my workflow). But Hazel only seems to allow sorting on a per "day" basis at best.

Is there a way to use Hazel to group photos into albums based on the event times? e.g all photos taken "around the same time" are pushed into a sub-folder.

Thanks in advance!
haze_l_user
 
Posts: 6
Joined: Sun Nov 11, 2012 10:48 am

Re: Sorting photos into albums Mon Nov 12, 2012 2:15 pm • by a_freyer
Do you ever have a use case where "around the same time" can have multiple events during the same day? If so, you're likely going to have to script this as "around the same time" is pretty ambiguous. Otherwise, days should be fine.

For a simple solution, I'd probably divide the dates into morning, noon and night. Else, you might be able to sort by geo-tag (assuming of course your photos are so tagged).
a_freyer
 
Posts: 631
Joined: Tue Sep 30, 2008 9:21 am
Location: Colorado

Re: Sorting photos into albums Tue Nov 13, 2012 5:38 am • by haze_l_user
Thanks so much for your reply! Unfortunately, yes there can be multiple events within a day. My events are separated by at least an hour, so I would need some way to put together all photos that are less than an hour apart. And yes, there is always at least a 1 hour gap between events.

I do have geo-tags as well but I may have multiple events (i.e. separated by an hour) at the same location.

If Hazel could do something like compare creation dates - e.g. if one token is "less than" 60 minutes away from another, sort into the same sub-folder - that would be great. But I don't think it can (currently) do that...

I must admit I have no idea how I would script this - any pointers at all would be extremely helpful and highly appreciated! (I know this is beyond mere Hazel usage, but solving this would really help me use Hazel in a much more powerful way and make this process so much simpler)

Thank you!
haze_l_user
 
Posts: 6
Joined: Sun Nov 11, 2012 10:48 am

Re: Sorting photos into albums Tue Nov 13, 2012 12:18 pm • by a_freyer
Basically, here is what I would do. I'm sorry that this isn't more than pseudocode - perhaps this weekend I'll have more time to delve into this problem.

(1) Separate your photos into day-based folders. This is easy with Hazel and it sounds like you've already got this figured out.
(2) Obtain a list of the files & order by creation date.
(3) In a loop starting with the youngest file, do something like this:

Code: Select all
for (theCurrentFile in myListOfFiles)
    theNextFile = myListOfFiles[theCurrentFile.index + 1]
    if (theNextFile.CreationDate - theCurrentFile.CreationDate > 60) then
        move theCurrentFile to theMoveFolder
        theMoveFolder =  create new folder
    else
       move theCurrentFile to theMoveFolder
    end if
next       


The basic idea is that you're moving every file that is an hour or more older than the next file when sorted by date into a specific "event" folder. If the next file is an hour or more younger than the current file in the loop, then you create a new event folder for the next file, while moving the last photo into the current event folder.

With applescript, this is relatively straightforward as a concept, but the implementation will be a bit tricky for an inexperienced coder.

Best of luck! I'll check back this weekend to see if I have time to write this out for you.
a_freyer
 
Posts: 631
Joined: Tue Sep 30, 2008 9:21 am
Location: Colorado

Re: Sorting photos into albums Wed Nov 14, 2012 3:49 am • by haze_l_user
That is really helpful, thanks! I am a novice at this, and I'll take any help I can get - even if it is pseudocode. I get the feeling that struggling to script this will be less painful than wading through all the photos manually, even on a per day basis!

Indeed, I can handle step 1 via Hazel on my own. I have started reading up about Applescript to deal with 2 & 3. Hopefully, Applescript is fairly "user friendly".

It would be fantastic if you could provide anything more, but you have already been extremely helpful and I understand if you cannot get to it. I will certainly give this my best shot too. :)

Thanks again!
haze_l_user
 
Posts: 6
Joined: Sun Nov 11, 2012 10:48 am

Re: Sorting photos into albums Mon Nov 28, 2016 12:05 pm • by webenchantressde
I know this is a rather old post (2012), but I am looking for the exact same type of sorting. Anyone find a solution for this they could post? Thank you.
webenchantressde
 
Posts: 1
Joined: Mon Nov 28, 2016 12:04 pm


Return to Support