Hi,
I’ve made a script that reminds me of upcoming birthdays, but my birthday scanning function runs slowly (it’s a repeat). Can anyone think of a way to optimize this code?
tell application "Address Book"
repeat with theperson in (every person whose birth date is not missing value)
set birthdate to birth date of theperson
if (month of birthdate is month of (current date) and day of birthdate is day of (current date)) then my birthdaynotify(the name of theperson, round (((current date) - birthdate) / days / 365.2423) rounding down, image of theperson)
end repeat
end tell
I’ve tried selecting people whose birthdays are today (well this month for simplification) directly with the following “whose” statement without success.
tell application "Address Book" to return people whose month of birth date is month of (current date)
Thanks in advance,
Ben