I'm pretty new at google app script, I've found the following script that will get me a list of contacts but it includes "other contacts" and I want to only grab the group "My Contacts" and list them last name and first name in two columns. I've been trying to figure that out but I'm at a loss.
function importFullName() {
var contacts = ContactApp.getContactGroup('My Contacts').getContacts(), output = [];
for(var i = 0, iLen = contacts.length; i < iLen; i++) {
var fullname = contacts[i].getFullName();
if(fullname) {
output.push([fullname]);
} else {
continue;
}
}
SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Contacts list").getRange(1, 1, output.length, 1).setValues(output);
}
This script works if I use ContactsApp.getContacts(), but doesn't once I change to getContactsGroup it stops working