Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
12.1
12.2
12.3
12.4
12.5
13.0
13.1
13.2
13.3
13.4
Statistic
FMM
Blog
Creates a new search element.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
Addressbook | 5.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | ❌ No |
This function was deprecated. Use Contacts functions instead.
Parameter | Description | Example |
---|---|---|
Type | Whether to make search element for group or person. Can be "Group" or "Person". | "Person" |
Property | The name of the property to search on, such as ABAddressProperty or ABLastNameProperty. | "LastNameProperty" |
Label | The label name for a multivalue list, such as kABAddressHomeLabel, kABPhoneWorkLabel, or a user-specified label, such as Summer Home. If the specified property does not have multiple values, pass "". If the specified property does have multiple values, pass "" to search all the values. | |
Key | The key name for a dictionary, such as kABAddressCityKey or kABAddressStreetKey. If the specified property is not a dictionary, pass "". If the specified property is a dictionary, pass "" to search all keys. | |
Value | What you’re searching for. If empty, then the only supported value for comparison is ABEqual or ABNotEqual. | |
Comparison | The comparison operator. Can be Equal, NotEqual, LessThan, LessThanOrEqual, GreaterThan, GreaterThanOrEqual, EqualCaseInsensitive, ContainsSubString, ContainsSubStringCaseInsensitive, PrefixMatch, PrefixMatchCaseInsensitive, BitsInBitFieldMatch, DoesNotContainSubString, DoesNotContainSubStringCaseInsensitive, NotEqualCaseInsensitive, SuffixMatch, SuffixMatchCaseInsensitive, WithinIntervalAroundToday, WithinIntervalAroundTodayYearless, NotWithinIntervalAroundToday, NotWithinIntervalAroundTodayYearless, WithinIntervalFromToday, WithinIntervalFromTodayYearless, NotWithinIntervalFromToday or NotWithinIntervalFromTodayYearless. | "Equal" |
Returns ID or error.
Find a person with first name being Christian:
Set Variable [$e1; Value:MBS( "Addressbook.searchElementForProperty"; "person"; "FirstNameProperty"; ""; ""; "Christian"; "Equal" )]
Set Variable [$records; Value:MBS( "Addressbook.recordsMatchingSearchElement"; $e1)]
Set Variable [$record; Value:GetValue($records; 1)]
Set Variable [$name; Value:MBS( "Addressbook.record.displayname"; $record )]
Show Custom Dialog [$name]
Search people with related name being John:
Set Variable [$e1; Value:MBS( "Addressbook.searchElementForProperty"; "person"; "RelatedNamesProperty"; ""; ""; "John"; "ContainsSubStringCaseInsensitive" )]
Set Variable [$records; Value:MBS( "Addressbook.recordsMatchingSearchElement"; $e1)]
Set Variable [$record; Value:GetValue($records; 1)]
Set Variable [$name; Value:MBS( "Addressbook.record.displayname"; $record )]
Show Custom Dialog [$name]
Find all companies:
# Companies have PersonFlags = 1 while normal people have 0.
Set Variable [$e; Value:MBS( "Addressbook.searchElementForProperty"; "person"; "PersonFlags"; ""; ""; 1; "Equal" )]
Set Variable [$records; Value:MBS( "Addressbook.recordsMatchingSearchElement"; $e)]
Set Variable [$record; Value:GetValue($records; 1)]
Set Variable [$name; Value:MBS( "Addressbook.record.displayname"; $record )]
Show Custom Dialog [$name]
This function is free to use.
Created 26th October 2015, last changed 26th October 2015
Addressbook.searchElementForConjunction - Addressbook.searchGroupsWithName