Events.Calendars
----------------

Returns calendars that support a given entity type.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Events](component_Events.md) | [6.2](newinversion62.md) | ✅ Yes | ❌ No | ❌ No | ❌ No | ✅ Yes |

MBS( "Events.Calendars"; Type { ; AsJSON } ) 

**MBS**( **"Events.Calendars";** /\* Returns calendars that support a given entity type. \*/  
**$Type**; /\* Which entity type you like to check: Event or Reminder.  
Default is Event.e.g. "Event" \*/   
**$AsJSON**) /\* Optional; Pass 1 to return result as JSON. \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| Type | Which entity type you like to check: Event or Reminder.   Default is Event. | "Event" |  |
| AsJSON | Pass 1 to return result as JSON. |  | Optional      Added in version **13.4**. |

### Result

Returns list of calendar identifiers or error.

### Description

Returns calendars that support a given entity type.  
Type can be Event or Reminder.  
If you have limited access to calendars, you may only see one virtual calendar.  
### Examples

Get list of all calendars for events:

 MBS ( "Events.calendars" ; "Events")  
Get list of all calendars for reminders:

 MBS ( "Events.calendars" ; "Reminder")  
Query list of all calendar names:

 While(   
\[   
 names = "";   
 // query list of Calendar IDs  
 list = MBS ( "Events.Calendars"; "Event" );   
 count = ValueCount(list);   
 index = 1  
\] ;   
 index ≤ count ;   
\[   
 id = GetValue(list; index);   
 // query name for each ID  
 name = MBS ( "[Events.Calendar.GetTitle](EventsCalendarGetTitle.md)"; id);   
 names = names &amp; name &amp; ¶;   
 index = index + 1   
\] ;   
// return all the names  
names )  
<small>  
Example result:   
Family  
Work  
Birthdays</small>Query as JSON:

 MBS ( "Events.Calendars"; "Reminder"; 1)  
<small>  
Example result:   
\[ { "subscribed" : false, "source" : { "sourceTypeText" : "CalDAV" , "title" : "Mac.com" , "sourceIdentifier" : "780DE199-35C3-4720-9FF0-D5CB37A4B7E6" , "isDelegate" : false, "sourceType" : 2 }, "title" : "Reminders" , "allowedEntityTypes" : 2 , "supportedEventAvailabilities" : 0 , "allowsContentModifications" : true, "type" : 1 , "immutable" : false, "calendarIdentifier" : "F01661A4-E434-4F9D-79CD-C7395B34D69C" , "typeText" : "CalDAV" }, { "subscribed" : false, "source" : { "sourceTypeText" : "CalDAV" , "title" : "Mac.com" , "sourceIdentifier" : "780DE199-35C3-4720-9FF0-D5CB37A4B7E6" , "isDelegate" : false, "sourceType" : 2 }, "title" : "Family" , "allowedEntityTypes" : 2 , "supportedEventAvailabilities" : 0 , "allowsContentModifications" : true, "type" : 1 , "immutable" : false, "calendarIdentifier" : "8A134D40-6DE4-4F69-A4D4-06CB897EB173" , "typeText" : "CalDAV" } \] </small>Test with limited permissions in macOS Sonoma:

 MBS ( "Events.Calendars"; "event"; 1)  
<small>  
Example result:   
\[ { "subscribed" : false, "source" : { "sourceTypeText" : "CalDAV" , "title" : "Account" , "sourceIdentifier" : "VIRTUAL\_APP\_SOURCE\_UUID" , "isDelegate" : false, "sourceType" : 2 }, "title" : "Calendar" , "allowedEntityTypes" : 1 , "supportedEventAvailabilities" : 0 , "allowsContentModifications" : true, "type" : 1 , "immutable" : true, "calendarIdentifier" : "VIRTUAL\_APP\_CALENDAR\_UUID" , "typeText" : "CalDAV" } \] </small>### See also

- [Events.Calendar.GetTitle](EventsCalendarGetTitle.md)
- [Events.Calendar.GetType](EventsCalendarGetType.md)
- [Events.Calendar.Subscribed](EventsCalendarSubscribed.md)
- [Events.NewCalendar](EventsNewCalendar.md)

### Release notes

- **Version 13.4**
    - Added AsJSON parameters to [Events.Calendars](https://www.mbsplugins.eu/EventsCalendars.shtml), [Events.Source.Calendars](https://www.mbsplugins.eu/EventsSourceCalendars.shtml), [Events.Item.GetCalendar](https://www.mbsplugins.eu/EventsItemGetCalendar.shtml), [Events.defaultCalendarForNewEvents](https://www.mbsplugins.eu/EventsdefaultCalendarForNewEvents.shtml), [Events.defaultCalendarForNewReminders](https://www.mbsplugins.eu/EventsdefaultCalendarForNewReminders.shtml), [Events.SourceWithType](https://www.mbsplugins.eu/EventsSourceWithType.shtml), [Events.Sources](https://www.mbsplugins.eu/EventsSources.shtml) and [Events.DelegateSources](https://www.mbsplugins.eu/EventsDelegateSources.shtml) functions to return result as JSON.

### Example Databases

- [Mac and iOS/Events/Events Changes](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Mac%20and%20iOS/Events/Events%20Changes.shtml#3ScriptAnchor_)
- [Mac and iOS/Events/Events Sync](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Mac%20and%20iOS/Events/Events%20Sync.shtml#1ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 13.4pr1](https://www.mbsplugins.de/archive/2023-08-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 3/2020, Seite 38](https://filemaker-magazin.de/neuigkeit/4096-Appetithappen-FMM_202003)

This function checks for a license.

Created 10th March 2016 , last changed 12nd October 2023

  
[Events.CalendarItemsWithExternalIdentifier](EventsCalendarItemsWithExternalIdentifier.md) - [Events.ClearNotification](EventsClearNotification.md)

[HTML Version](EventsCalendars.shtml)