hi all, I am working on an applescript in Filemaker to automatically add a contact’s birthday to iCal. It works up to creating the date as a new event in Ical but I’m not sure how to add a repeat every year step. Quite important, otherwise all it does is create one date in your calendar, which might be in the 1980s for example.
thanks for any ideas!
-- grab the data from Filemaker
tell application "FileMaker Pro"
tell current record
set theCalendarTitle to cellValue of cell "Birthdays"
set theSummary to cellValue of cell "FULL NAME"
set theStartDate to cellValue of cell "Date of Birth"
set theEndDate to cellValue of cell "Date of Birth"
set theAllDay to cellValue of cell "All Day for Birthday Calendar"
set theRecurrence to cellValue of cell "Repeat"
end tell
end tell
set theStartDateAsText to theStartDate
set theEndDateAsText to theEndDate
-- convert text to dates
set theStartDate to date theStartDateAsText
set theEndDate to date theEndDateAsText
-- create the event in iCal
tell application "iCal"
activate
-- make new calendar if need be
set allCalendarTitles to the title of every calendar
if allCalendarTitles contains theCalendarTitle then
set theCalendarNumber to (first calendar whose title is theCalendarTitle)
else
set theCalendarNumber to (make calendar at end of calendars with properties {title:theCalendarTitle})
end if
-- make event
set theEvent to make event at end of events of theCalendarNumber
-- set the event properties
tell theEvent
set start date to theStartDate
set end date to theEndDate
set recurrenceDate to theStartDate
set summary to theSummary
if theAllDay = "1" then
set allday event to true
end if
set recurrence to theRecurrence
end tell
show theEvent
end tell