It would be possible by adding a dialog to ask for the day and the month.
Or we could add a dialog with a few buttons for predefined days, for example a button "Christmas", "Thanksgiving", "Dad's Birthday". These would have to be defined by each user personally.
You could try this: The script asks for the day and month in the format dd:mm
After entering the day and month click the OK button, and then wait. It takes several minutes to search my library with 50000 photos.
-- Find all photos taken on a certain day, for example the day of the current date.
-- The resulting photos will be added to a toplevel album named "On <day> <month>".
-- Author Léonie, March 8,2016, modified on november 20, 2018
set userCanceled to false
try
set dialogResult to display dialog ¬
"Enter the day and month in the format dd:mm" buttons {"Cancel", "OK"} ¬
default button "OK" cancel button ¬
"Cancel" giving up after 15 ¬
default answer "24:12"
on error number -128
set userCanceled to true
end try
if userCanceled then
-- statements to execute when user cancels
display dialog "User cancelled."
return "User cancelled."
else if gave up of dialogResult then
display dialog "User timed out."
return "timeout"
end if
-- parse the dd:mm string
set theresult to the text returned of dialogResult
set thisdate to the (current date) as date-- create a date object
set the month of thisdate to ((word 2 of theresult) as number)
set the day of thisdate to ((word 1 of theresult) as number)
set thisday to the day of (thisdate as date)
set thismonth to the month of (thisdate as date)
--return {thisday, thismonth}
set thisDayAlbum to "On " & thismonth & " " & thisday as string
tell application "Photos"
try
if existscontainerthisDayAlbum then
delete the containerthisDayAlbum
delay 2 -- second try after delay
end if
makealbumnamedthisDayAlbum-- create a new, empty album
on error errTexttwonumbererrNumtwo
display dialog "Cannot create album: " & thisDayAlbum & " " & errNumtwo & return & errTexttwo
return
end try
set onthisdayFound to {}
set onthisdaySkipped to {}
set allTheItems to every media item-- get a list of all photos and videos, may take a while
-- add all photos taken this day to the album
repeat with i from 1 to the count of allTheItems
-- check the dates of all photos and videos
set thisMediaItem to itemi of allTheItems
try
set date_i to the date of thisMediaItem
set day_i to the day of (date_i as date)
set month_i to the month of (date_i as date)
if ((day_i = thisday) and (month_i = thismonth)) then
set end of onthisdayFound to thisMediaItem
add {thisMediaItem} tocontainerthisDayAlbum
end if
on error errTexttwonumbererrNumtwo
set end of onthisdaySkipped to thisMediaItem
end try
end repeat
end tell
set theresultmessage to "Found " & (the count of onthisdayFound) & " items and added them to the album " & thisDayAlbum & ".
Skipped " & (the count of onthisdaySkipped) & " items without date"
display dialogtheresultmessage