ABSearchElementMBS class
Online Documentation - Statistics - FAQ - Plugin Parts (All , Dependencies ) - Class hierarchy
New in Version
22.2
22.3
22.4
22.5
23.0
23.1
23.2
23.3
23.4
23.5
24.0
24.1
The list of the topics ,
classes ,
interfaces ,
controls ,
modules ,
global methods by category ,
global methods by name ,
screenshots ,
licenses
and examples .
Platforms to show: All Mac Windows Linux Cross-Platform
ABSearchElementMBS class Deprecated
A class for a search element.
Example
// search and display all entries with a given name in a 2 column listbox with address // Save reference to caller. dim addr as new ABAddressBookMBS // Initialise the Address Book plugin dim searchName as string = "Schmitz" // search on. // Do the search dim srch as ABSearchElementMBS = addr.searchElementForPersonProperty(addr.kABLastNameProperty, "" , "" , searchName, addr.kABContainsSubStringCaseInsensitive)dim srchRes() as ABRecordMBS = addr.recordsMatchingSearchElement(srch) // Get the results into an array for each rc as ABRecordMBS in srchRes if rc isa ABPersonMBS then // Is it a person record? dim pers as ABPersonMBS = ABPersonMBS (rc) // Get it into a personnel record // Now get out the names and addresses. listbox1.AddRow(pers.valueForProperty(addr.kABFirstNameProperty) + " " + pers.valueForProperty(addr.kABLastNameProperty)) listbox1.RowTag(listbox1.LastIndex) = pers.valueForProperty(addr.kABUIDProperty) // Need to find the home address. dim mlv as ABMultiValueMBS = pers.valueForProperty(addr.kABAddressProperty) if mlv <> nil Then // get home address dim d as Dictionary = mlv.valueForLabel(addr.kABHomeLabel) if d = nil then // get primary d = mlv.valueForIdentifier(mlv.primaryIdentifier) end if if d<>Nil then // show address with street and city listbox1.Cell(listbox1.LastIndex,1 ) = d.Lookup(addr.kABAddressStreetKey,"" )+" " +d.Lookup(addr.kABAddressCityKey,"" ) end if end if end if next
Use searchElementForProperty in ABPersonMBS and ABGroupMBS classes to create objects.
All methods in this class will catch exceptions from Cocoa and raise a NSExceptionMBS instead. Using the message, name and reason properties you can see what was the reason for this exception. Please report if you find a method which does not handle exceptions correct.
This is an abstract class. You can't create an instance, but you can get one from various plugin functions.
3 properties
2 methods
shared method searchElementForConjunction (conjunction as Integer, children() as ABSearchElementMBS) as ABSearchElementMBS
2 constants
Constants
Constant
Value
Description
kABSearchAnd
0
A search conjunction.
kABSearchOr
1
A search conjunction.
This class has no sub classes.
Some methods using this class:
ABAddressBookMBS.recordsMatchingSearchElement (search as ABSearchElementMBS) as ABRecordMBS ()
ABAddressBookMBS.searchElementForConjunction (conjunction as Integer, children() as ABSearchElementMBS) as ABSearchElementMBS
ABAddressBookMBS.searchElementForGroupProperty (PropertyName as string, Label as string, Key as string, value as Variant, comparison as Integer) as ABSearchElementMBS
ABAddressBookMBS.searchElementForPersonProperty (PropertyName as string, Label as string, Key as string, value as Variant, comparison as Integer) as ABSearchElementMBS
ABGroupMBS.searchElementForProperty (PropertyName as string, Label as string, Key as string, value as Variant, comparison as Integer) as ABSearchElementMBS
ABPersonMBS.searchElementForProperty (PropertyName as string, Label as string, Key as string, value as Variant, comparison as Integer) as ABSearchElementMBS
Some examples using this class:
Blog Entries
The items on this page are in the following plugins: MBS MacCocoa Plugin .
ABRecordMBS
-
ACAccountCredentialMBS