Platforms to show: All Mac Windows Linux Cross-Platform

Back to ABAddressBookMBS class.

ABAddressBookMBS.ABAddressBookErrorDomain as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Addressbook MBS MacCocoa Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The error domain for Addressbook.

ABAddressBookMBS.ABMultiValueIdentifiersErrorKey as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Addressbook MBS MacCocoa Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
One of the error keys for the addressbook.

ABAddressBookMBS.addressBook as ABAddressBookMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Addressbook MBS MacCocoa Plugin 12.5 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns a new instance of ABAddressBook, or nil if the Address Book database can't be initialized.

If you're just making one-off lookups and edits, the sharedAddressBook method is probably more appropriate.
If the user denies your application access to the Address Book database, this method returns nil.

Available in OS X v10.5 and later.
You need to use this method if you want to get an addressbook for ABPersonViewMBS.

ABAddressBookMBS.GotSharedAddressbook as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Addressbook MBS MacCocoa Plugin 12.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Whether some other part of your app queried the shared addressbook already.

sharedAddressbook asks for permissions the first time you call it.
So with this function you can check if some other application part already queried the sharedAddressbook function. If true, a call to sharedAddressbook should return quickly. Either with nil (no permissions) or the addressbook.

Some examples using this method:

ABAddressBookMBS.searchElementForConjunction(conjunction as Integer, children() as ABSearchElementMBS) as ABSearchElementMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Addressbook MBS MacCocoa Plugin 7.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Creates a search element combining several sub search elements.

Convenience function which can be used instead of ABSearchElementMBS.searchElementForConjunction.

ABAddressBookMBS.searchElementForGroupProperty(PropertyName as string, Label as string, Key as string, value as Variant, comparison as Integer) as ABSearchElementMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Addressbook MBS MacCocoa Plugin 7.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns a search element that will search groups.

Convenience function to be used instead of the searchElementForProperty method in the ABGroupMBS class.

ABAddressBookMBS.searchElementForPersonProperty(PropertyName as string, Label as string, Key as string, value as Variant, comparison as Integer) as ABSearchElementMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Addressbook MBS MacCocoa Plugin 7.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns a search element that will search people.
Example
// search person by record's unique ID
// this is same as calling recordForUniqueId function directly
Var a as new ABAddressBookMBS
Var e as ABSearchElementMBS

Var PropertyName as string = a.kABUIDProperty
const Label = ""
const Key = ""
const value = "637FA922-7A2B-4F9A-BFA3-023253D4A3D5:ABPerson" // some person ID
const comparison = a.kABEqual

e = ABPersonMBS.searchElementForProperty(PropertyName, label, key, value, comparison)

Var records() as ABRecordMBS = a.recordsMatchingSearchElement(e)

for each r as ABRecordMBS in records
Var p as ABPersonMBS = ABPersonMBS(r)

MsgBox p.DisplayName
next

Convenience function to be used instead of the searchElementForProperty method in the ABPersonMBS class.

Some examples using this method:

ABAddressBookMBS.sharedAddressbook as ABAddressBookMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Addressbook MBS MacCocoa Plugin 12.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the shared addressbook object.
Example
// quickly find the addressbook, locate me and display my name:
MsgBox ABAddressBookMBS.sharedAddressbook.owner.DisplayName

If you call this method several times, the object is cached, so it's only created the first time (singleton).
Returns nil on Windows or Linux or low memory or missing permissions.

Some examples using this method:

ABAddressBookMBS.sharedAddressbookMT as ABAddressBookMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Addressbook MBS MacCocoa Plugin 12.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the shared addressbook object.

On Mac OS X 10.8, the user will be asked to allow access to the addressbook for your application. As the call to sharedAddressbook blocks in this case, this method can be called on a thread to avoid the blocking of your app.

If you call this method several times, the object is cached, so it's only created the first time (singleton).
Returns nil on Windows or Linux or low memory or missing permissions.

The work is performed on a preemptive thread, so this function does not block the application and can yield time to other Xojo threads. Must be called in a Xojo thread to enjoy benefits. If called in main thread will block, but keep other background threads running.

Some examples using this method:

The items on this page are in the following plugins: MBS MacCocoa Plugin.


The biggest plugin in space...