Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
Addressbook.multivalue.addValue
Adds a value and its label to a multivalue list.
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 |
---|---|---|
value | The value to add. | "test@test.test" |
label | The label to associate with the value. | "Work" |
Result
Returns identifier or error.
Description
Adds a value and its label to a multivalue list.Returns the new identifier if value is added successfully; otherwise, nil.
Possible labels are:
kABHomePageLabel, kABEmailWorkLabel, kABEmailHomeLabel, kABAddressHomeLabel, kABAddressWorkLabel, kABAnniversaryLabel, kABFatherLabel, kABMotherLabel, kABParentLabel, kABBrotherLabel, kABSisterLabel, kABChildLabel, kABFriendLabel, kABSpouseLabel, kABPartnerLabel, kABAssistantLabel, kABManagerLabel, kABPhoneWorkLabel, kABPhoneHomeLabel, kABPhoneiPhoneLabel, kABPhoneMobileLabel, kABPhoneMainLabel, kABPhoneHomeFAXLabel, kABPhoneWorkFAXLabel, kABPhonePagerLabel, kABAIMWorkLabel, kABAIMHomeLabel, kABJabberWorkLabel, kABJabberHomeLabel, kABMSNWorkLabel, kABMSNHomeLabel, kABYahooWorkLabel, kABYahooHomeLabel, kABICQWorkLabel, kABICQHomeLabel, kABWorkLabel, kABHomeLabel, kABOtherLabel or kABMobileMeLabel.
Examples
Add a new URL to a contact:
Set Variable [$r; MBS( "Addressbook.multivalue.New") ]
Set Variable [$ID; MBS( "Addressbook.multivalue.addValue"; "http://www.mbsplugins.de"; "WorkLabel" ) ]
Set Variable [$r; MBS( "Addressbook.multivalue.setPrimaryIdentifier"; $ID ) ]
Set Variabel [$r; MBS( "Addressbook.record.SetValueForProperty"; $personID; "URLsProperty"; "multivalue" ) ]
Add work and home emails:
$r = MBS( "Addressbook.multivalue.New" )
$WorkEmailID = MBS( "Addressbook.multivalue.addValue"; Addressbook::WorkEmail; "EmailWorkLabel" )
$HomeEmailID = MBS( "Addressbook.multivalue.addValue"; Addressbook::HomeEmail; "EmailHomeLabel" )
$r = MBS( "Addressbook.multivalue.setPrimaryIdentifier"; $WorkEmailID )
$r = MBS( "Addressbook.record.SetValueForProperty"; $personID; "EmailProperty"; "multivalue" )
Add an address:
# Add one address
Set Variable [$result; Value:MBS ( "Addressbook.multivalue.New"; 1 )
Set Variable [$id; Value:MBS ( "Addressbook.multivalue.addAddress"; $str; $plz; $ort; $land; ""; "" )]
Set Variable [$result; Value:MBS ( "Addressbook.multivalue.setPrimaryIdentifier"; $id )]
Set Variable [$result; Value:MBS ( "Addressbook.record.SetValueForProperty"; $personID; "AddressProperty"; "multivalue" )]
Add an email:
Set Variable [$result; Value:MBS ( "Addressbook.multivalue.New")
Set Variable [$id; Value:MBS ( "Addressbook.multivalue.addValue"; $email; "EmailWorkLabel" )]
Set Variable [$result; Value:MBS ( "Addressbook.multivalue.setPrimaryIdentifier"; $id )]
Set Variable [$result; Value:MBS ( "Addressbook.record.SetValueForProperty"; $personID; "EmailProperty"; "multivalue" )]
Add phone numbers:
Set Variable [$result; Value:MBS ( "Addressbook.multivalue.New"]
Set Variable [$tel_id; Value:MBS ( "Addressbook.multivalue.addValue"; $tel; "PhoneWorkLabel" )]
Set Variable [$mob_id; Value:MBS ( "Addressbook.multivalue.addValue"; $mob; "PhoneMobileLabel" )]
Set Variable [$result; Value:MBS ( "Addressbook.multivalue.setPrimaryIdentifier"; $mob_id )]
Set Variable [$result; Value:MBS ( "Addressbook.record.SetValueForProperty"; $personID; "PhoneProperty"; "multivalue" )]
Add homepage URLs:
# add homepages
Set Variable [ $r ; Value: MBS( "Addressbook.multivalue.New" ) ]
Set Variable [ $Blog_URL_ID ; Value: MBS( "Addressbook.multivalue.addValue"; "http://www.mbsplugins.de/"; "Blog" ) ]
Set Variable [ $Homepage_URL_ID ; Value: MBS( "Addressbook.multivalue.addValue"; "http://www.monkeybreadsoftware.com/"; "HomePageLabel" ) ]
Set Variable [ $r ; Value: MBS( "Addressbook.multivalue.setPrimaryIdentifier"; $Homepage_URL_ID ) ]
Set Variable [ $r ; Value: MBS( "Addressbook.record.SetValueForProperty"; $personID; "URLsProperty"; "multivalue" ) ]
See also
- Addressbook.addRecord
- Addressbook.multivalue.addAddress
- Addressbook.multivalue.count
- Addressbook.multivalue.identifiers
- Addressbook.multivalue.insertValue
- Addressbook.multivalue.labels
- Addressbook.multivalue.New
- Addressbook.multivalue.setPrimaryIdentifier
- Addressbook.multivalue.values
- Addressbook.save
Example Databases
Blog Entries
This function checks for a license.
Created 18th August 2014, last changed 25th January 2024
Addressbook.multivalue.addAddress - Addressbook.multivalue.count