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: 9.5   10.0   10.1   10.2   10.3   10.4   10.5   11.0   11.1   11.2    Statistic    FMM    Blog  

CNContact.Value

Queries the value of contact.

Component Version macOS Windows Linux Server iOS SDK
Contacts 8.4 ✅ Yes ❌ No ❌ No ❌ No ✅ Yes
MBS( "CNContact.Value"; ContactIdentifier; Selector { ; ImageType; FileName } )   More

Parameters

Parameter Description Example Flags
ContactIdentifier The contact identifier. "46B1E34D-58F9-4B6B-A80D-0F71ABB87A0E"
Selector Which value to return. "nickname"
ImageType The type of image to return.
Either JPEG, PNG, GIF or BMP. Default is JPEG.
"JPEG" Optional
FileName The filename to use for the picture.
Default is "image" with the extension matching the image type.
"test.jpg" Optional

Result

Returns value or error.

Description

Queries the value of contact.
Selector can be birthday, contactRelations, dates, departmentName, emailAddresses, familyName, givenName, imageData, imageDataAvailable, instantMessageAddresses, jobTitle, middleName, namePrefix, nameSuffix, nickname, nonGregorianBirthday, organizationName, phoneNumbers, phoneticFamilyName, phoneticGivenName, phoneticMiddleName, phoneticOrganizationName, postalAddresses, previousFamilyName, socialProfiles, thumbnailImageData, note, type or urlAddresses.
ImageData and thumbnailImageData are returned as container and you can pass in ImageType and FileName to use.
PhoneNumbers, emailAddresses, postalAddresses, urlAddresses, contactRelations, socialProfiles, instantMessageAddresses, dates, birthday and nonGregorianBirthday are returned as JSON.

Examples

Get my phone numbers:

MBS("CNContact.Value"; MBS("CNContactStore.UnifiedMeContact"); "phonenumbers")

Example result:
[
  {
    "identifier" : "7AA474C5-CB5B-406F-9C19-077E14E8F48B",
    "label" : "_$!<Mobile>!$_",
    "value" : "+49 1234 56789"
  },
  {
    "identifier" : "96F71635-B932-49C5-ABA6-905528A152D0",
    "label" : "_$!<Work>!$_",
    "value" : "+49 1234 56789"
  }
]

Get my social profiles:

MBS("CNContact.Value"; MBS("CNContactStore.UnifiedMeContact"); "socialprofiles")

Example result:
[
  {
    "identifier" : "DC992125-7999-4C52-ADF6-D544BC3ADA04",
    "label" : "Twitter",
    "value" : {
      "username" : "MBSPlugins",
      "userIdentifier" : null,
      "service" : "Twitter",
      "urlString" : "http:\/\/twitter.com\/MBSPlugins"
    }
  },
  {
    "identifier" : "4D26EDF7-EE68-4125-AAF1-C79C5D4A66AA",
    "label" : "Facebook",
    "value" : {
      "username" : "MonkeybreadSoftware",
      "userIdentifier" : null,
      "service" : "Facebook",
      "urlString" : "http:\/\/facebook.com\/MonkeybreadSoftware"
    }
  }
]

Get image of contact as container value:

MBS( "CNContact.Value"; $contact; "imageData")

Query email addresses:

MBS( "CNContact.Value"; "BD2307E5-92F6-4A8F-946D-C4804615C18B:ABPerson"; "emailAddresses")

See also

Blog Entries

Created 1st August 2018, last changed 29th September 2020


CNContact.UnifiedContacts - CNContactPicker.Close

Feedback: Report problem or ask question.