Creating Gmail Contacts by script
You can create Gmail Contacts by script using the createContact
method of the ContactsApp
class. For example, if the name is Anika Sumi and the e-mail ID is <anika@example.com>
, then the ContactsApp.createContact("Anika", "Sumi", "anika@example.com")
code will create the expected contact.
To know more available methods of the ContactsApp
class, in the code editor, type ContactsApp
and .
(a dot) next to it. Then, you can view all the available methods with parameter details in code hint as shown in the following screenshot:
You can see deprecated methods struck out in the preceding screenshot; you are advised not to use those methods.