Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

Platforms to show: All Mac Windows Linux Cross-Platform

Next items

ABAddressBookMBS.accountWithIdentifier(Identifier as string) as ABAccountMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Addressbook MBS MacCocoa Plugin 15.0 Yes No No Yes, macOS only No
Function: Finds account with matching identifier.

Feedback, Comments & Corrections

ABAddressBookMBS.addRecord(record as ABRecordMBS) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Addressbook MBS MacCocoa Plugin 7.1 Yes No No Yes, macOS only No
Function: Adds a record (ABPersonMBS or ABGroup) to the AddressBook Database
Example:
dim a as new ABAddressBookMBS
dim p as new ABPersonMBS

if not p.setValue("Miller",a.kABLastNameProperty) then
MsgBox "Failed to set field "+a.LocalizedPropertyOrLabel(a.kABLastNameProperty)
end if

if not p.setValue("Ben",a.kABFirstNameProperty) then
MsgBox "Failed to set field "+a.LocalizedPropertyOrLabel(a.kABFirstNameProperty)
end if

if a.addRecord(p) then
MsgBox "Record added"
else
MsgBox "Failed to add record"
end if

if a.save then
MsgBox "Changes saved"
else
MsgBox "Failed to save changes"
end if
Notes: Returns true if the addition was successful

See also:

Feedback, Comments & Corrections

ABAddressBookMBS.addRecord(record as ABRecordMBS, Account as ABAccountMBS, byref error as NSErrorMBS) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Addressbook MBS MacCocoa Plugin 15.0 Yes No No Yes, macOS only No
Function: Adds a record (ABPersonMBS or ABGroup) to the AddressBook Database with given account.
Notes:
Returns true if the addition was successful.
On Mac OS X 10.7 the error parameter is set to describe the error.

See also:

Feedback, Comments & Corrections

ABAddressBookMBS.addRecord(record as ABRecordMBS, byref error as NSErrorMBS) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Addressbook MBS MacCocoa Plugin 11.2 Yes No No Yes, macOS only No
Function: Adds a record (ABPersonMBS or ABGroup) to the AddressBook Database.
Notes:
Returns true if the addition was successful.
On Mac OS X 10.7 the error parameter is set to describe the error.

See also:

Feedback, Comments & Corrections

ABAddressBookMBS.allAccounts as ABAccountMBS()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Addressbook MBS MacCocoa Plugin 15.0 Yes No No Yes, macOS only No
Function: Queries list of all accounts.
Example:
dim a as new ABAddressBookMBS
dim accounts() as ABAccountMBS = a.allAccounts
Break // look in debugger

Feedback, Comments & Corrections

ABAddressBookMBS.Constructor
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Addressbook MBS MacCocoa Plugin 13.5 Yes No No Yes, macOS only No
Function: The constructor.

Feedback, Comments & Corrections

ABAddressBookMBS.enabledAccounts as ABAccountMBS()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Addressbook MBS MacCocoa Plugin 15.0 Yes No No Yes, macOS only No
Function: Queries list of enabled accounts.
Example:
dim a as new ABAddressBookMBS
dim accounts() as ABAccountMBS = a.enabledAccounts
Break // look in debugger

Feedback, Comments & Corrections

ABAddressBookMBS.EnableEvent
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Addressbook MBS MacCocoa Plugin 12.0 Yes No No Yes, macOS only No
Function: Activates the events in this class.
Notes: You only need to call this if you use AddHandler command in Real Studio to add event handlers. The plugin automatically does that in the constructor, but that is too early for AddHandler. And plugin on enables events if you use them.

Feedback, Comments & Corrections

ABAddressBookMBS.formattedAddressFromDictionary(address as Dictionary) as NSAttributedStringMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Addressbook MBS MacCocoa Plugin 7.2 Yes No No Yes, macOS only No
Function: Returns an attributed string containing the formatted address.
Notes:
The string's attributes match address dictionary keys (kABAddressStreetKey for example).
Each attribute value contains the localized description of the key. (For example, the value of a Canadian kABAddressZIPKey field would be Postal Code)

Feedback, Comments & Corrections

ABAddressBookMBS.groupForName(name as string) as ABGroupMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Addressbook MBS MacCocoa Plugin 12.3 Yes Yes Yes Yes No
Function: Searches the group with the given name.
Example:
dim a as new ABAddressBookMBS
dim name as string = "Some Group"
dim g as ABGroupMBS = a.groupForName(name)
MsgBox g.DisplayName+": "+str(g.members.Ubound+1)

Feedback, Comments & Corrections

ABAddressBookMBS.groupForUniqueId(uniqueid as string) as ABGroupMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Addressbook MBS MacCocoa Plugin 11.3 Yes No No Yes, macOS only No
Function: Returns a ABGroupMBS matching a given unique ID.
Example:
dim a as new ABAddressBookMBS

// you have some uid
dim groups() as ABGroupMBS = a.groups
dim uid as string = groups(0).valueForProperty(a.kABUIDProperty)

// later you want to find the group
dim g as ABGroupMBS = a.groupForUniqueId(uid)

// shows the name
MsgBox g.valueForProperty(a.kABGroupNameProperty)
Notes:
Returns nil if the record could not be found or matches to a person.
Available in Mac OS X 10.3 or newer.
see also recordForUniqueId.

See also:

Feedback, Comments & Corrections

ABAddressBookMBS.groupForUniqueId(uniqueid as string, account as ABAccountMBS) as ABGroupMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Addressbook MBS MacCocoa Plugin 15.0 Yes No No Yes, macOS only No
Function: Finds a group for given unique ID for given account.

See also:

Feedback, Comments & Corrections

ABAddressBookMBS.groups as ABGroupMBS()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Addressbook MBS MacCocoa Plugin 11.2 Yes No No Yes, macOS only No
Function: Returns an array of all the groups in the AddressBook database
Example:
// list all email addresses in one group

Dim book as ABAddressBookMBS
dim groups() as ABGroupMBS
dim person as ABPersonMBS
dim data as ABMultiValueMBS
dim s as string

book=new ABAddressBookMBS

groups=book.groups

for each group as ABGroupMBS in groups
If group.valueForProperty(book.kABGroupNameProperty)= "test" then // or any valid group
dim members() as ABPersonMBS = group.members

for each member as ABPersonMBS in members

data=person.valueForProperty(book.kABEmailProperty)

if data<>nil then
for k as Integer=data.count-1 downto 0
s=s+data.valueAtIndex(k)+EndOfLine
next
end if
next
end if
Next
msgBox s
Notes:
Returns an empty array in case the DB doesn't contain any groups.
Returns nil on any error.

Feedback, Comments & Corrections

ABAddressBookMBS.groupsForAccount(account as ABAccountMBS) as ABGroupMBS()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Addressbook MBS MacCocoa Plugin 15.0 Yes No No Yes, macOS only No
Function: Returns an array of all the groups for this account.
Example:
dim a as new ABAddressBookMBS
dim c as ABAccountMBS = a.defaultAccount
dim groups() as ABGroupMBS = a.groupsForAccount(c)

Break // look in debugger
Notes: Returns an empty array in case the DB doesn't contain any body.

Feedback, Comments & Corrections

ABAddressBookMBS.LocalizedPropertyOrLabel(propertyOrLabel as string) as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Addressbook MBS MacCocoa Plugin 7.1 Yes No No Yes, macOS only No
Function: Returns the localized version of built in properties, labels or keys
Notes: Returns propertyOrLabel if not found (e.g. if not built in).

Feedback, Comments & Corrections

ABAddressBookMBS.NewPersonWithVCardRepresentation(data as memoryblock) as ABPersonMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Addressbook MBS MacCocoa Plugin 7.1 Yes No No Yes, macOS only No
Function: Create a person from a vCard.
Notes:
Returns nil on failure.
Convenience function which cen be used instead of the ABPersonMBS constructor.

Feedback, Comments & Corrections

ABAddressBookMBS.people as ABPersonMBS()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Addressbook MBS MacCocoa Plugin 11.2 Yes No No Yes, macOS only No
Function: Returns an array of all the people in the AddressBook database
Example:
dim a as new ABAddressBookMBS

// get all people
dim p(-1) as ABPersonMBS = a.people

// walk over people list
for each m as ABPersonMBS in p
try
// ask for image

dim j as NSImageMBS = m.image

// do something with image
if j<>nil then
Backdrop=j.CopyPictureWithMask
end if

catch x as NSExceptionMBS
// raises exception if there is no image
end try
next
Notes:
Returns an empty array in case the DB doesn't contain any body.
Returns nil on any error.

Feedback, Comments & Corrections

ABAddressBookMBS.peopleForAccount(account as ABAccountMBS) as ABPersonMBS()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Addressbook MBS MacCocoa Plugin 15.0 Yes No No Yes, macOS only No
Function: Returns an array of all the people for this account.
Example:
dim a as new ABAddressBookMBS
dim c as ABAccountMBS = a.defaultAccount
dim people() as ABPersonMBS = a.peopleForAccount(c)

Break // look in debugger
Notes: Returns an empty array in case the DB doesn't contain any body.

Feedback, Comments & Corrections

ABAddressBookMBS.peopleForEmail(email as string) as ABPersonMBS()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Addressbook MBS MacCocoa Plugin 12.3 Yes Yes Yes Yes No
Function: Searches a contact for the given email.
Example:
dim a as new ABAddressBookMBS
dim persons() as ABPersonMBS = a.peopleForEmail("support@monkeybreadsoftware.de")

if UBound(persons) >= 0 then
MsgBox persons(0).DisplayName
else
MsgBox "nothing found."
end if

Feedback, Comments & Corrections

ABAddressBookMBS.persistentAccounts as ABAccountMBS()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Addressbook MBS MacCocoa Plugin 15.0 Yes No No Yes, macOS only No
Function: Queries list of all persistent accounts.
Example:
dim a as new ABAddressBookMBS
dim accounts() as ABAccountMBS = a.persistentAccounts
Break // look in debugger

Feedback, Comments & Corrections

ABAddressBookMBS.personForUniqueId(uniqueid as string) as ABPersonMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Addressbook MBS MacCocoa Plugin 11.3 Yes No No Yes, macOS only No
Function: Returns a ABPersonMBS matching a given unique ID.
Example:
dim a as new ABAddressBookMBS

// you have some uid
dim uid as string = a.owner.valueForProperty(a.kABUIDProperty)

// later you want to find the person
dim p as ABPersonMBS = a.personForUniqueId(uid)

// shows the name
MsgBox p.valueForProperty(a.kABFirstNameProperty)
Notes:
Returns nil if the record could not be found or matches to a group.
Available in Mac OS X 10.3 or newer.
see also recordForUniqueId.

See also:

Feedback, Comments & Corrections

ABAddressBookMBS.personForUniqueId(uniqueid as string, account as ABAccountMBS) as ABPersonMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Addressbook MBS MacCocoa Plugin 15.0 Yes No No Yes, macOS only No
Function: Finds a person for given unique ID for given account.

See also:

Feedback, Comments & Corrections

ABAddressBookMBS.recordClassFromUniqueId(uniqueid as string) as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Addressbook MBS MacCocoa Plugin 7.1 Yes No No Yes, macOS only No
Function: Given a record uniqueId returns the record class name.
Notes: Return "ABPersonMBS" or "ABGroup" or "" for a given uniqueid.

Feedback, Comments & Corrections

ABAddressBookMBS.recordForUniqueId(uniqueid as string) as ABRecordMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Addressbook MBS MacCocoa Plugin 7.1 Yes No No Yes, macOS only No
Function: Returns a record (ABPersonMBS or ABGroup) matching a given unique ID.
Example:
dim a as new ABAddressBookMBS

// you have some uid
dim uid as string = a.owner.valueForProperty(a.kABUIDProperty)

// later you want to find the person
dim r as ABRecordMBS = a.recordForUniqueId(uid)
if r isa ABPersonMBS then
dim p as ABPersonMBS = ABPersonMBS(r)

// shows the name
MsgBox p.valueForProperty(a.kABFirstNameProperty)
end if
Notes:
Returns nil if the record could not be found.
Available in Mac OS X 10.3 or newer.

See also:

Feedback, Comments & Corrections

ABAddressBookMBS.recordForUniqueId(uniqueid as string, account as ABAccountMBS) as ABRecordMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Addressbook MBS MacCocoa Plugin 15.0 Yes No No Yes, macOS only No
Function: Finds a record for given unique ID for given account.

See also:

Feedback, Comments & Corrections

ABAddressBookMBS.recordsMatchingSearchElement(search as ABSearchElementMBS) as ABRecordMBS()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Addressbook MBS MacCocoa Plugin 11.2 Yes No No Yes, macOS only No
Function: Returns an array of records matching the given search element
Example:
dim ab as new ABAddressBookMBS

// search for people with birthday, by searching for dates starting 1901.
dim searchDate as new date( 1901, 1, 1 )
dim search as ABSearchElementMBS = ab.SearchElementForPersonProperty( ab.kABBirthdayProperty, "", "", searchDate, ab.kABGreaterThan )

// do the search
dim people() as ABRecordMBS = ab.RecordsMatchingSearchElement( search )


for each person as ABRecordMBS in people
dim p as ABPersonMBS = ABPersonMBS( person )
// now work on them
next
Notes: Returns an empty array if no matches or an error.

Feedback, Comments & Corrections

ABAddressBookMBS.removeRecord(record as ABRecordMBS) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Addressbook MBS MacCocoa Plugin 7.1 Yes No No Yes, macOS only No
Function: Removes a record (ABPersonMBS or ABGroup) from the AddressBook Database
Notes: Returns true if the removal was successful.

See also:

Feedback, Comments & Corrections

ABAddressBookMBS.removeRecord(record as ABRecordMBS, byref error as NSErrorMBS) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Addressbook MBS MacCocoa Plugin 11.2 Yes No No Yes, macOS only No
Function: Removes a record (ABPersonMBS or ABGroup) from the AddressBook Database.
Notes:
Returns true if the removal was successful.
On Mac OS X 10.7 the error parameter is set to describe the error.

See also:

Feedback, Comments & Corrections

ABAddressBookMBS.save as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Addressbook MBS MacCocoa Plugin 7.1 Yes No No Yes, macOS only No
Function: Saves changes made since the last save.
Notes: Return true if successful (or there was no change).

See also:

Feedback, Comments & Corrections

Next items

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




Links
MBS Xojo Plugins