Platforms to show: All Mac Windows Linux Cross-Platform

FAQ.How to create a birthday like calendar event?

Answer: Try this code:
Example
// start a connection to the calendar database
Var s as new CalCalendarStoreMBS

// needed for the error details
Var e as NSErrorMBS

Var r as CalRecurrenceRuleMBS = CalRecurrenceRuleMBS.initYearlyRecurrence(1, nil) // repeat every year without end

Var a as new CalAlarmMBS // add alarm
a.action = a.CalAlarmActionDisplay
a.relativeTrigger = -3600*24 // 24 Hours before

// create a new calendar
Var c as new CalEventMBS

Var d as new date(2011, 04, 20) // the date

Var calendars() as CalCalendarMBS = s.calendars

// set properties
c.Title="Test Birthday"
c.startDate=d
c.recurrenceRule = r
c.calendar=calendars(0) // add to first calendar
c.addAlarm(a)
c.endDate = d
c.isAllDay = true

// save event
call s.saveEvent(c,s.CalSpanAllEvents, e)
if e<>nil then
MsgBox e.localizedDescription
else
MsgBox "New event was created."
end if

This adds an event to iCal for the given date with alarm to remember you and repeats it every year.


The biggest plugin in space...