Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

CNContactStore.Containers

Queries identifiers of all containers.

Component Version macOS Windows Linux Server iOS SDK
Contacts 8.4 ✅ Yes ❌ No ❌ No ❌ No ✅ Yes
MBS( "CNContactStore.Containers" )

Parameters

none

Result

Returns list or error.

Description

Queries identifiers of all containers.
This should return list of accounts for contacts.

Examples

Query all accounts:

MBS( "CNContactStore.Containers" )

Example result:
9892A5CC-964E-497A-B877-A47619F7493C:ABAccount
_local

Queries container types:

While(
[
    names = "";
    // query list of containers IDs
    list = MBS( "CNContactStore.Containers" );
    count = ValueCount(list);
    index = 1
] ;
    index ≤ count ;
[
    id = GetValue(list; index);
    // query name for each ID
    name = MBS( "CNContainer.Name"; id);
    type = MBS( "CNContainer.Type"; id);
    names = names & name & " -> " & type & ¶;
    index = index + 1
] ;
// return all the names
names )

See also

Blog Entries

This function checks for a license.

Created 15th August 2018, last changed 14th June 2022


CNContactStore.ContainerForGroup - CNContactStore.Country