Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
Addressbook.record.valueForProperty
Returns the value of a given property for a record.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
Addressbook | 3.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | ✅ Yes |
Deprecated
This function was deprecated. Use Contacts functions instead.
Parameters
Parameter | Description | Example |
---|---|---|
RecordID | The unique ID for the target person or group. | $personID |
PropertyName | The name of the property to query. | "EmailProperty" |
Result
Returns the value of a given property for a record.
Description
Returns the value of a given property for a record.Possible property names are UIDProperty, CreationDateProperty, ModificationDateProperty, FirstNameProperty, LastNameProperty, FirstNamePhoneticProperty, LastNamePhoneticProperty, NicknameProperty, MaidenNameProperty, BirthdayProperty, BirthdayComponentsProperty, OrganizationProperty, JobTitleProperty, HomePageProperty, URLsProperty, CalendarURIsProperty, EmailProperty, AddressProperty, OtherDatesProperty, OtherDateComponentsProperty, RelatedNamesProperty, DepartmentProperty, PhoneProperty, AIMInstantProperty, JabberInstantProperty, MSNInstantProperty, YahooInstantProperty, ICQInstantProperty, InstantMessageProperty, SocialProfileProperty, NoteProperty, MiddleNameProperty, MiddleNamePhoneticProperty, TitleProperty, SuffixProperty and GroupNameProperty.
Examples
Query first name of a person:
MBS( "Addressbook.record.valueForProperty"; $personID; "FirstNameProperty" )
Query group name of a group:
MBS( "Addressbook.record.valueForProperty"; "57956420-03A4-4C09-8219-6874B897D25F:ABGroup"; "GroupName" )
Query my ID:
MBS( "Addressbook.record.valueForProperty"; MBS( "Addressbook.me") ; "UIDProperty" )
Query creation date of my record:
MBS( "Addressbook.record.valueForProperty"; MBS( "Addressbook.me") ; "CreationDateProperty" )
Query birthday of my record:
MBS( "Addressbook.record.valueForProperty"; MBS( "Addressbook.me") ; "BirthdayProperty" )
Query birthday components for my record:
MBS( "Addressbook.record.valueForProperty"; MBS( "Addressbook.me") ; "BirthdayComponentsProperty" )
Query my company name:
MBS( "Addressbook.record.valueForProperty"; MBS( "Addressbook.me") ; "OrganizationProperty" )
Query my job title:
MBS( "Addressbook.record.valueForProperty"; MBS( "Addressbook.me") ; "JobTitleProperty" )
Query my department:
MBS( "Addressbook.record.valueForProperty"; MBS( "Addressbook.me") ; "DepartmentProperty" )
Query my note:
MBS( "Addressbook.record.valueForProperty"; MBS( "Addressbook.me") ; "NoteProperty" )
Query all my URLs:
Set Variable [$personID; Value:MBS( "Addressbook.me")]
Set Variable [$Urls; Value:MBS( "Addressbook.record.valueForProperty"; $personID; "URLsProperty")]
Set Variable [$count; Value:MBS( "Addressbook.multivalue.count")]
If [$count > 0]
#for loop
Set Variable [$index; Value:0]
Loop
Set Variable [$value; Value:MBS( "Addressbook.multivalue.valueAtIndex"; $index)]
Show Custom Dialog ["URL"; $value]
#next
Set Variable [$index; Value:$index + 1]
Exit Loop If [$index = $count]
End Loop
End If
Shows different emails:
Set Variable [$personID; Value:"637FA922-7A2B-4F9A-BFA3-023253D4A3D5:ABPerson"]
Set Variable [$r; Value:MBS( "Addressbook.record.valueForProperty"; $personID; "EmailProperty" )]
Set Variable [$w; Value:MBS( "Addressbook.multivalue.valueForLabel"; "EmailWorkLabel" )]
Set Variable [$h; Value:MBS( "Addressbook.multivalue.valueForLabel"; "EmailHomeLabel" )]
Set Variable [$o; Value:MBS( "Addressbook.multivalue.valueForLabel"; "OtherLabel" )]
Show Custom Dialog ["Emails"; "Work email: " & $w & ¶ & "Home email: " & $h & ¶ & "Other email: " & $o]
# there may be more than 3 labels!
Show note of an user:
MBS( "Addressbook.record.valueForProperty"; "637FA922-7A2B-4F9A-BFA3-023253D4A3D5:ABPerson"; "NoteProperty" )
Query an address:
# Find someone...
Set Variable [ $personID ; Value: MBS( "Addressbook.searchPeopleWithName"; "Jon"; "Test" ) ]
If [ Length($personID) > 0 ]
# get Address
Set Variable [ $r ; Value: MBS( "Addressbook.record.valueForProperty"; $personID; "AddressProperty" ) ]
Set Variable [ $Address ; Value: MBS( "Addressbook.multivalue.valueAtIndex"; 0) ]
Show Custom Dialog [ "Address" ; $Address ]
End If
Example result:
Street=Some street. 123
Zip=12345
Country=Deutschland
City=Test
See also
- Addressbook.formattedAddress
- Addressbook.multivalue.count
- Addressbook.multivalue.identifiers
- Addressbook.multivalue.labels
- Addressbook.multivalue.valueAtIndex
- Addressbook.multivalue.valueForLabel
- Addressbook.multivalue.values
- Addressbook.record.removeValueForProperty
- Addressbook.record.SetValueForProperty
- Addressbook.searchPeopleWithName
Example Databases
Blog Entries
This function checks for a license.
Created 18th August 2014, last changed 9th December 2019
Addressbook.record.removeValueForProperty - Addressbook.recordsMatchingSearchElement