Platforms to show: All Mac Windows Linux Cross-Platform

Back to ABAddressBookMBS class.

Previous items

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
dim a as new ABAddressBookMBS
dim e as ABSearchElementMBS

dim 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)

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

for each r as ABRecordMBS in records
dim 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:

Previous items

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


💬 Ask a question or report a problem
The biggest plugin in space...