Google Contacts group with Apps script

Why and How - EOJJI Blog 게시물 중 [usage] Autocomplete Email Addresses in Apps Script - Google Apps를 세부적으로 살펴보면 search_(e) 함수에 사용된 UI Service가 더 이상 지원되지 않습니다.

function search_(e){
  var app = UiApp.getActiveApplication();

UI Service Deprecated. The UI service was deprecated on December 11, 2014. To create user interfaces, use the HTML service instead.

더 나은 방법으로 Google 주소록에서 연락처를 그룹으로 관리하는 방법을 추천합니다.
당연히 그룹에 연락처를 추가할 때 이메일 자동 완성 기능이 지원됩니다.

참조:



연락처 그룹 만들기


  1. Google 주소록으로 이동합니다.
  2. 왼쪽에서 그룹 다음 새 그룹을 클릭합니다.
  3. 새로운 그룹 이름을 입력합니다.
  4. 그룹 만들기를 클릭합니다.



Google Contacts - Group



Google Contacts - Group - New Group - eojji folder



그룹에 연락처 추가


  1. Google 주소록으로 이동합니다.
  2. 연락처의 사진 또는 사용자 사용자 위로 마우스를 이동한 후 표시되는 체크박스를 선택합니다. 연락처 이름 옆에 사진이나 아이콘이 표시되지 않으면 기존 주소록의 그룹 연락처로 이동합니다.
  3. 오른쪽 상단에서 그룹 그룹 주소록을 클릭합니다.
  4. 연락처를 추가하려는 그룹 이름을 클릭합니다. 연락처가 추가된 그룹 옆에 체크 표시가 나타납니다.



Google Contacts - Group - eojji folder Group 사용자 추가


Google Contacts - Group - eojji folder Group 사용자 추가(기존 연락처)



Google Contacts - Group - eojji folder Group 사용자 추가


Google Apps Script - Reference - contacts - contact-group - getContacts()

https://developers.google.com/apps-script/reference/contacts/contact-group#getContacts()
 // The code below retrieves all the contacts in the group named "Work Friends"
 var group = ContactsApp.getContactGroup('Work Friends');
 var contacts = group.getContacts();



Google Apps Script - Reference - contacts - contact - getEmails() 

https://developers.google.com/apps-script/reference/contacts/contact#getEmails()
 // The code below retrieves a contact named "John Doe" and logs the email addresses
 // associated with that contact
 var contacts = ContactsApp.getContactsByName('John Doe');
 var emails = contacts[0].getEmails();
 for (var i in emails) {
   Logger.log(emails[i].getAddress());
 }


Google 사진 앨범: https://goo.gl/photos/sCmMwKN6EuT1165J6 

댓글

이 블로그의 인기 게시물

Duplicate files, Deduper in Google Drive