property calendar_title : "Birthdays" -- the title of the calendar to which the events should be added property before_name : "" -- appended before the person's name in the event title property after_name : " birthday" -- appended after the person's name in the event title property alarm_days : 0 -- which day the alarm should start property alarm_hours : 9 -- which hour the alarm should start property alarm_minutes : 0 -- which minute the alarm should start property sound_name : "Basso" -- the name of the sound used for the alarm tell application "iCal" set myCalendar to (the first calendar whose title is calendar_title) delete every event of myCalendar end tell tell application "Address Book" repeat with myPerson in every person if birth date of myPerson exists then set myBirthday to birth date of myPerson set mySummary to before_name & (name of myPerson) & after_name set myAllDayEvent to true set myRecurrence to "FREQ=YEARLY;INTERVAL=1;BYMONTH=" & (month of myBirthday as integer) set myTriggerInterval to (alarm_days * 24 + alarm_hours) * 60 + alarm_minutes tell application "iCal" set myEvent to (make new event with properties {summary:mySummary, allday event:myAllDayEvent, start date:myBirthday, end date:myBirthday, recurrence:myRecurrence} at end of myCalendar) set myAlarm to (make new sound alarm with properties {sound name:sound_name, trigger interval:myTriggerInterval} at end of myEvent) end tell end if end repeat end tell