Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
12.1
12.2
12.3
12.4
12.5
13.0
13.1
13.2
13.3
13.4
Statistic
FMM
Blog
Saves changes to a calendar, or adds a new calendar to the database.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
Events | 6.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | ✅ Yes |
Parameter | Description | Example | Flags |
---|---|---|---|
EKCalendar | The identifier or name of the calendar. | $calendar | |
Commit | Whether to commit. Pass 1 to commit or 0 to not commit. Default is 1. Pass 0 to batch changes together and commit with Events.Commit later. |
1 | Optional |
Returns OK or error.
Create a new calendar:
# We need a source to add the new calendar to. I prefer local, but newer macOS doesn't have it, so we use caldav for iCloud
Set Variable [ $source ; Value: MBS( "Events.SourceWithType"; "local" ) ]
If [ IsEmpty ( $source ) ]
Set Variable [ $source ; Value: MBS( "Events.SourceWithType"; "caldav" ) ]
End If
# New calendar for events
Set Variable [ $calendar ; Value: MBS( "Events.NewCalendar"; "Event" ) ]
# configure it
Set Variable [ $r ; Value: MBS( "Events.Calendar.SetTitle"; $Calendar; "Test" ) ]
Set Variable [ $r ; Value: MBS( "Events.Calendar.SetColor"; $Calendar; "red" ) ]
Set Variable [ $r ; Value: MBS( "Events.Calendar.SetSource"; $Calendar; $Source ) ]
# save to database
Set Variable [ $r ; Value: MBS( "Events.SaveCalendar"; $calendar ;1 ) ]
# and check what ID we got for later
Set Variable [ $id ; Value: MBS( "Events.Calendar.CalendarIdentifier"; $Calendar ) ]
Show Custom Dialog [ "Saved calendar" ; $r & ¶ & $id ]
This function checks for a license.
Created 10th March 2016, last changed 13th July 2023