已淘汰的方法
已淘汰的方法
addAddress(label, address)
addAddress(label, address)
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
使用標準或自訂標籤將地址新增至聯絡人。
標籤來源可以是 ContactsApp.Field 或自訂標籤字串。
// The code below retrieves a contact named "John Doe" and adds the address // "123 Main St, Some City, NY 10011" with the the ContactsApp.Field.WORK_ADDRESS label. var contacts = ContactsApp.getContactsByName('John Doe'); var address = contacts[0].addAddress(ContactsApp.Field.WORK_ADDRESS, '123 Main St, Some City, NY 10011');
參數
名稱 | 類型 | 說明 |
---|---|---|
label | Object | 新地址的標籤 (來自 ContactsApp.Field 或自訂字串) |
address | String | 新地址 |
回攻員
:新建立的欄位AddressField
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
另請參閱
addCompany(company, title)
addCompany(company, title)
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
將公司新增為聯絡人。
// The code below retrieves a contact named "John Doe" and adds the company "Google" and the // job title "Product Manager". var contacts = ContactsApp.getContactsByName('John Doe'); var url = contacts[0].addCompany('Google', 'Product Manager');
參數
名稱 | 類型 | 說明 |
---|---|---|
company | String | 要加進此聯絡人的公司名稱 |
title | String | 與此公司聯絡人相關聯的職稱 |
回攻員
:新建立的欄位CompanyField
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
另請參閱
addCustomField(label, content)
addCustomField(label, content)
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
使用延伸或自訂標籤為聯絡人新增自訂欄位。
標籤來源可以是 ContactsApp.ExtendedField 或自訂標籤字串。
// The code below retrieves a contact named "John Doe" and adds the custom field // ContactsApp.ExtendedField.HOBBY with the value "hiking". // Note that ContactsApp.ExtendedField.HOBBY is not the same as a custom field named 'HOBBY'. var contacts = ContactsApp.getContactsByName('John Doe'); contacts[0].addCustomField(ContactsApp.ExtendedField.HOBBY, 'hiking');
參數
名稱 | 類型 | 說明 |
---|---|---|
label | Object | 新地址的標籤 (來自 ContactsApp.ExtendedField 或自訂字串) |
content | Object | 要儲存在自訂欄位中的值 |
回攻員
:新建立的欄位CustomField
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
另請參閱
addDate(label, month, day, year)
addDate(label, month, day, year)
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
使用標準或自訂標籤為聯絡人新增日期。
標籤來源可以是 ContactsApp.Field 或自訂標籤字串。
// The code below retrieves a contact named "John Doe" and adds a // ContactsApp.ExtendedField.BIRTHDAY with the value "April 19, 1950". var contacts = ContactsApp.getContactsByName('John Doe'); var birthday = contacts[0].addDate(ContactsApp.Field.BIRTHDAY, ContactsApp.Month.APRIL, 19, 1950);
參數
名稱 | 類型 | 說明 |
---|---|---|
label | Object | 新日期的標籤 (來自 ContactsApp.Field 或自訂字串) |
month | Month | 當月,從 ContactApps.Month |
day | Integer | 這一天 |
year | Integer | 這一年 |
回攻員
:新建立的日期DateField
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
另請參閱
addEmail(label, address)
addEmail(label, address)
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
新增加上標準標籤 (住家、公司等) 或自訂標籤的電子郵件地址
// The code below retrieves a contact named "John Doe" and adds the email address // "j.doe@example.com" to the ContactsApp.Field.HOME_EMAIL label. var contacts = ContactsApp.getContactsByName('John Doe'); var emailField = contacts[0].addEmail(ContactsApp.Field.HOME_EMAIL, 'j.doe@example.com');
參數
名稱 | 類型 | 說明 |
---|---|---|
label | Object | 新電子郵件的標籤 (來自 ContactsApp.Field 或自訂字串) |
address | String | 新電子郵件地址 |
回攻員
:新增的欄位EmailField
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
addIM(label, address)
addIM(label, address)
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
使用標準或自訂標籤將即時訊息地址新增至聯絡人。
標籤來源可以是 ContactsApp.Field 或自訂標籤字串。
// The code below retrieves a contact named "John Doe" and adds the IM address "ChatWithJohn" // with the the ContactsApp.Field.AIM label. var contacts = ContactsApp.getContactsByName('John Doe'); var email = contacts[0].addIM(ContactsApp.Field.AIM, 'ChatWithJohn');
參數
名稱 | 類型 | 說明 |
---|---|---|
label | Object | 新即時通訊地址的標籤 (來自 ContactsApp.Field 或自訂字串) |
address | String | 新的即時通訊地址 |
回攻員
:新建立的欄位IMField
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
另請參閱
addPhone(label, number)
addPhone(label, number)
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
使用標準或自訂標籤將電話號碼新增至聯絡人。
標籤來源可以是 ContactsApp.Field 或自訂標籤字串。
// The code below retrieves a contact named "John Doe" and adds the phone number // "212-555-1234" with the the ContactsApp.Field.WORK_PHONE label. var contacts = ContactsApp.getContactsByName('John Doe'); var phone = contacts[0].addPhone(ContactsApp.Field.WORK_PHONE, '212-555-1234');
參數
名稱 | 類型 | 說明 |
---|---|---|
label | Object | 新電話號碼的標籤 (來自 ContactsApp.Field 或自訂字串) |
number | String | 新的電話號碼 |
回攻員
:新建立的欄位PhoneField
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
另請參閱
addToGroup(group)
addToGroup(group)
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
將這位聯絡人新增至指定的聯絡人群組。
// The code below creates a new contact and then adds it to the contact group named // "Work Friends" var contact = ContactsApp.createContact('John', 'Doe', 'john.doe@example.com'); var group = ContactsApp.getContactGroup('Work Friends'); contact = contact.addToGroup(group);
參數
名稱 | 類型 | 說明 |
---|---|---|
group |
| 要將這位聯絡人新增到哪個聯絡人群組 |
回攻員
— 這位聯絡人Contact
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
另請參閱
addUrl(label, url)
addUrl(label, url)
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
使用標準或自訂標籤為聯絡人新增網址。
標籤來源可以是 ContactsApp.Field 或自訂標籤字串。
// The code below retrieves a contact named "John Doe" and adds the URL // "http://www.example.com" with the the ContactsApp.Field.WORK_WEBSITE label. var contacts = ContactsApp.getContactsByName('John Doe'); var url = contacts[0].addUrl(ContactsApp.Field.WORK_WEBSITE, 'http://www.example.com');
參數
名稱 | 類型 | 說明 |
---|---|---|
label | Object | 新地址的標籤 (來自 ContactsApp.Field 或自訂字串) |
url | String | 新的網址 |
回攻員
:新建立的欄位UrlField
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
另請參閱
deleteContact()
deleteContact()
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
刪除這位聯絡人。
var contacts = ContactsApp.getContactsByName('John Doe'); for (var i in contacts) { contacts[i].deleteContact(); }
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
getAddresses()
getAddresses()
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
取得這位聯絡人的所有地址。
// The code below logs the addresses of all the contacts whose names contain "John Doe" var contacts = ContactsApp.getContactsByName('John Doe'); for (var i in contacts) { Logger.log(contacts[i].getAddresses()); }
回攻員
:地址清單AddressField[]
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
另請參閱
getAddresses(label)
getAddresses(label)
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
取得這位聯絡人與特定欄位相符的所有地址。
標籤來源可以是 ContactsApp.Field 或自訂標籤字串。
// The code below retrieves a contact named "John Doe" and logs the addresses // associated with that contact that are in the ContactsApp.Field.WORK_ADDRESS label. var contacts = ContactsApp.getContactsByName('John Doe'); var addresses = contacts[0].getAddresses(ContactsApp.Field.WORK_ADDRESS); for (var i in addresses) { Logger.log(addresses[i].getAddress()); }
參數
名稱 | 類型 | 說明 |
---|---|---|
label | Object | 要比對的標籤 (來自 ContactsApp.Field 或自訂字串) |
回攻員
:地址清單AddressField[]
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
另請參閱
getCompanies()
getCompanies()
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
取得此聯絡人的所有公司。
// The code below logs the company names of all the contacts whose names contain "John Doe" var contacts = ContactsApp.getContactsByName('John Doe'); for (var i in contacts) { var companies = contacts[i].getCompanies(); for (var j in companies) { Logger.log(companies[j].getCompanyName()); } }
回攻員
:公司清單CompanyField[]
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
另請參閱
getContactGroups()
getContactGroups()
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
取得包含這位聯絡人的所有聯絡人群組。
// The code below gets a contact named "John Doe" and retrieves all the contact groups that // the contact belongs to var contacts = ContactsApp.getContactsByName('John Doe'); var groups = contacts[0].getContactGroups();
回攻員
:包含這位聯絡人的群組ContactGroup[]
另請參閱
getCustomFields()
getCustomFields()
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
取得這位聯絡人的所有自訂欄位。
// The code below retrieves a contact named "John Doe" and logs the custom fields // associated with that contact var contacts = ContactsApp.getContactsByName('John Doe'); var fields = contacts[0].getCustomFields(); for (var i in fields) { Logger.log(fields[i].getValue()); }
回攻員
:自訂欄位清單CustomField[]
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
另請參閱
getCustomFields(label)
getCustomFields(label)
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
取得這位聯絡人與特定欄位相符的所有自訂欄位。
標籤可以是 ContactsApp.ExtendedField 中的標準標籤或自訂標籤字串。
// The code below retrieves a contact named "John Doe" and logs the custom fields // associated with that contact that are in the ContactsApp.ExtendedField.HOBBY label. var contacts = ContactsApp.getContactsByName('John Doe'); var hobbies = contacts[0].getCustomFields(ContactsApp.ExtendedField.HOBBY); for (var i in hobbies) { Logger.log(hobbies[i].getValue()); }
參數
名稱 | 類型 | 說明 |
---|---|---|
label | Object | 要比對的標籤 (來自 ContactsApp.ExtendedField 或自訂字串) |
回攻員
:自訂欄位清單CustomField[]
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
另請參閱
getDates()
getDates()
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
取得這位聯絡人的所有日期。
// The code below retrieves a contact named "John Doe" and logs the label of the date // associated with that contact var contacts = ContactsApp.getContactsByName('John Doe'); var dates = contacts[0].getDates(); for (var i in dates) { Logger.log(dates[i].getLabel()); }
回攻員
:日期清單DateField[]
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
另請參閱
getDates(label)
getDates(label)
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
取得這位聯絡人與特定欄位相符的所有日期。
標籤可以是 ContactsApp.Field 中的標準標籤,也可以是自訂標籤字串。
// The code below retrieves a contact named "John Doe" and logs the day of the month // associated with that contact that are in the ContactsApp.Field.BIRTHDAY label. var contacts = ContactsApp.getContactsByName('John Doe'); var birthdays = contacts[0].getDates(ContactsApp.Field.BIRTHDAY); for (var i in birthdays) { Logger.log(birthdays[i].getDay()); }
參數
名稱 | 類型 | 說明 |
---|---|---|
label | Object | 要比對的標籤 (來自 ContactsApp.Field 或自訂字串) |
回攻員
:日期清單DateField[]
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
另請參閱
getEmailAddresses()
getEmailAddresses()
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
取得這位聯絡人可用的電子郵件地址清單。
回攻員
String[]
:這位聯絡人可用的電子郵件地址清單
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
getEmails()
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()); }
回攻員
:聯絡人的電子郵件地址清單EmailField[]
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
另請參閱
getEmails(label)
getEmails(label)
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
取得與特定欄位相符的這位聯絡人的電子郵件地址。
標籤可以是 ContactsApp.Field 中的標準標籤,也可以是自訂標籤字串。
// The code below retrieves a contact named "John Doe" and logs the email addresses // associated with that contact that are in the ContactsApp.Field.HOME_EMAIL label. var contacts = ContactsApp.getContactsByName('John Doe'); var emails = contacts[0].getEmails(ContactsApp.Field.HOME_EMAIL); for (var i in emails) { Logger.log(emails[i].getAddress()); }
參數
名稱 | 類型 | 說明 |
---|---|---|
label | Object | 要比對的標籤 (來自 ContactsApp.Field 或自訂字串) |
回攻員
:聯絡人的電子郵件地址清單EmailField[]
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
另請參閱
getFamilyName()
getFamilyName()
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
以字串形式取得聯絡人的姓氏 (姓氏)。
// The code below logs the family name of all the contacts whose names contain "John" var contacts = ContactsApp.getContactsByName('John'); for (var i in contacts) { Logger.log(contacts[i].getFamilyName()); }
回攻員
String
:聯絡人的姓氏
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
另請參閱
getFullName()
getFullName()
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
取得聯絡人的全名 (提供姓名和姓氏),以字串表示。
// The code below logs the full name of all the contacts whose names contain "John" var contacts = ContactsApp.getContactsByName('John'); for (var i in contacts) { Logger.log(contacts[i].getFullName()); }
回攻員
String
:聯絡人的全名
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
另請參閱
getGivenName()
getGivenName()
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
取得聯絡人的名字 (名字),做為字串。
// The code below logs the given name of all the contacts whose names contain "Smith" var contacts = ContactsApp.getContactsByName('Smith'); for (var i in contacts) { Logger.log(contacts[i].getGivenName()); }
回攻員
String
:聯絡人的姓名
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
另請參閱
getHomeAddress()
getHomeAddress()
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
取得這位聯絡人的住家地址;如果沒有這個字串,則會輸入空白字串。
回攻員
String
:這位聯絡人的住家地址或空白字串 (如果沒有)
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
getHomeFax()
getHomeFax()
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
取得此聯絡人的住家傳真號碼,如果不存在,則會取得空白字串。
回攻員
String
:這位聯絡人的住家傳真號碼,如果不存在,則為空字串
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
getHomePhone()
getHomePhone()
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
取得這位聯絡人的住家電話號碼,如果沒有的話,則會取得空白字串。
回攻員
String
:這位聯絡人的住家電話號碼或空白字串 (如果沒有)
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
getIMs()
getIMs()
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
取得這位聯絡人的所有即時通訊地址。
// The code below logs the IM addresses of all the contacts whose names contain "John Doe" var contacts = ContactsApp.getContactsByName('John Doe'); for (var i in contacts) { Logger.log(contacts[i].getIMs()); }
回攻員
:即時通訊地址清單IMField[]
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
另請參閱
getIMs(label)
getIMs(label)
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
取得這位聯絡人與特定欄位相符的所有即時通訊地址。
標籤來源可以是 ContactsApp.Field 或自訂標籤字串。
// The code below retrieves a contact named "John Doe" and logs the IM addresses // associated with that contact that are in the ContactsApp.Field.GOOGLE_TALK label. var contacts = ContactsApp.getContactsByName('John Doe'); var imAddresses = contacts[0].getIMs(ContactsApp.Field.GOOGLE_TALK); for (var i in imAddresses) { Logger.log(imAddresses[i].getAddress()); }
參數
名稱 | 類型 | 說明 |
---|---|---|
label | Object | 要比對的標籤 (來自 ContactsApp.Field 或自訂字串) |
回攻員
:即時通訊地址清單IMField[]
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
另請參閱
getId()
getId()
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
傳回這位聯絡人的專屬 ID。
var contact = ContactsApp.createContact('John', 'Doe', 'john.doe@example.com'); var id = contact.getId();
回攻員
String
:這位聯絡人的 ID
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
getInitials()
getInitials()
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
取得聯絡人的姓名縮寫。
// The code below logs the initials of all the contacts whose names contain "John Doe" var contacts = ContactsApp.getContactsByName('John Doe'); for (var i in contacts) { Logger.log(contacts[i].getInitials()); }
回攻員
String
:聯絡人的姓名縮寫
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
另請參閱
getLastUpdated()
getLastUpdated()
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
取得這位聯絡人的上次更新日期。
// The code below logs the last updated date of all the contacts whose names contain // "John Doe" var contacts = ContactsApp.getContactsByName('John Doe'); for (var i in contacts) { Logger.log(contacts[i].getLastUpdated()); }
回攻員
Date
:這位聯絡人的上次更新日期
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
getMaidenName()
getMaidenName()
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
以字串形式取得聯絡人的娘家姓名。
// The code below logs the maiden name of all the contacts whose names contain "Jane" var contacts = ContactsApp.getContactsByName('Jane'); for (var i in contacts) { Logger.log(contacts[i].getMaidenName()); }
回攻員
String
:聯絡人的婚前姓名
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
另請參閱
getMiddleName()
getMiddleName()
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
以字串形式取得聯絡人的中間名稱。
// The code below logs the middle name of all the contacts whose names contain "Smith" var contacts = ContactsApp.getContactsByName('Smith'); for (var i in contacts) { Logger.log(contacts[i].getMiddleName()); }
回攻員
String
:聯絡人的中間名稱
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
另請參閱
getMobilePhone()
getMobilePhone()
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
取得這位聯絡人的手機號碼或空白字串 (如果沒有的話)。
回攻員
String
:這位聯絡人的手機號碼或空白字串 (如果沒有)
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
getNickname()
getNickname()
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
取得聯絡人的暱稱 (以字串形式表示)。
// The code below logs the nickname of all the contacts whose names contain "John Doe" var contacts = ContactsApp.getContactsByName('John Doe'); for (var i in contacts) { Logger.log(contacts[i].getNickname()); }
回攻員
String
:聯絡人的暱稱
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
另請參閱
getNotes()
getNotes()
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
取得與這位聯絡人相關聯的附註;如果沒有附註,則會輸入空白字串。
// The code below logs the notes of all the contacts whose names contain "John Doe" var contacts = ContactsApp.getContactsByName('John Doe'); for (var i in contacts) { Logger.log(contacts[i].getNotes()); }
回攻員
String
:與這位聯絡人相關的附註
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
另請參閱
getPager()
getPager()
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
取得此聯絡人的呼叫器電話號碼;如果沒有,則會取得空白字串。
回攻員
String
:這位聯絡人的呼叫器電話號碼或空白字串 (如果沒有)
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
getPhones()
getPhones()
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
取得這位聯絡人的所有電話號碼。
// The code below logs the phone numbers of all the contacts whose names contain "John Doe" var contacts = ContactsApp.getContactsByName('John Doe'); for (var i in contacts) { Logger.log(contacts[i].getPhones()); }
回攻員
:電話號碼清單PhoneField[]
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
另請參閱
getPhones(label)
getPhones(label)
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
取得這位聯絡人與特定欄位相符的所有電話號碼。
標籤來源可以是 ContactsApp.Field 或自訂標籤字串。
// The code below retrieves a contact named "John Doe" and logs the phone numbers // associated with that contact that are in the ContactsApp.Field.WORK_PHONE label. var contacts = ContactsApp.getContactsByName('John Doe'); var phones = contacts[0].getPhones(ContactsApp.Field.WORK_PHONE); for (var i in phones) { Logger.log(phones[i].getPhoneNumber()); }
參數
名稱 | 類型 | 說明 |
---|---|---|
label | Object | 要比對的標籤 (來自 ContactsApp.Field 或自訂字串) |
回攻員
:電話號碼清單PhoneField[]
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
另請參閱
getPrefix()
getPrefix()
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
取得聯絡人名稱的前置字串。
// The code below logs the prefix of all the contacts whose names contain "John Doe" var contacts = ContactsApp.getContactsByName('John Doe'); for (var i in contacts) { Logger.log(contacts[i].getPrefix()); }
回攻員
String
:聯絡人名稱的前置字串
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
另請參閱
getPrimaryEmail()
getPrimaryEmail()
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
取得聯絡人的主要電子郵件地址 (以字串形式表示)。
// The code below logs the primary email address of all the contacts whose names contain // "John Doe" var contacts = ContactsApp.getContactsByName('John Doe'); for (var i in contacts) { Logger.log(contacts[i].getPrimaryEmail()); }
回攻員
String
:聯絡人的主要電子郵件地址
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
getShortName()
getShortName()
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
以字串形式取得聯絡人的簡稱。
// The code below logs the short name of all the contacts whose names contain "Johnathan" var contacts = ContactsApp.getContactsByName('Johnathan'); for (var i in contacts) { Logger.log(contacts[i].getShortName()); }
回攻員
String
:聯絡人的簡稱
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
另請參閱
getSuffix()
getSuffix()
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
取得聯絡人名稱的後置字串。
// The code below logs the suffix of all the contacts whose names contain "John Doe" var contacts = ContactsApp.getContactsByName('John Doe'); for (var i in contacts) { Logger.log(contacts[i].getSuffix()); }
回攻員
String
:聯絡人姓名的後置字串
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
另請參閱
getUrls()
getUrls()
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
取得這位聯絡人的所有網址。
// The code below logs the URLs of all the contacts whose names contain "John Doe" var contacts = ContactsApp.getContactsByName('John Doe'); for (var i in contacts) { Logger.log(contacts[i].getUrls()); }
回攻員
:網址清單UrlField[]
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
另請參閱
getUrls(label)
getUrls(label)
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
取得這位聯絡人與特定欄位相符的所有網址。
標籤來源可以是 ContactsApp.Field 或自訂標籤字串。
// The code below retrieves a contact named "John Doe" and logs the URLs // associated with that contact that are in the ContactsApp.Field.WORK_WEBSITE label. var contacts = ContactsApp.getContactsByName('John Doe'); var urls = contacts[0].getUrls(ContactsApp.Field.WORK_WEBSITE); for (var i in urls) { Logger.log(urls[i].getAddress()); }
參數
名稱 | 類型 | 說明 |
---|---|---|
label | Object | 要比對的標籤 (來自 ContactsApp.Field 或自訂字串) |
回攻員
:網址清單UrlField[]
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
另請參閱
getUserDefinedField(key)
getUserDefinedField(key)
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
取得與指定鍵相關聯的使用者定義值。
參數
名稱 | 類型 | 說明 |
---|---|---|
key | String | 鍵可以是任何基本類型 (字串、 int 等) |
回攻員
String
:透過這組金鑰儲存的使用者定義內容
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
getUserDefinedFields()
getUserDefinedFields()
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
取得使用者為該聯絡人定義的所有欄位,並以 JavaScript 物件屬性的形式傳回這些欄位。
回攻員
Object
:使用者為該聯絡人定義的欄位,做為 JavaScript 物件的屬性
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
getWorkAddress()
getWorkAddress()
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
取得此聯絡人的公司地址;如果沒有,則傳回空白字串。
回攻員
String
:這位聯絡人的工作地址或空白字串 (如果沒有)
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
getWorkFax()
getWorkFax()
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
取得此聯絡人的工作傳真號碼或空白字串 (如果沒有的話)。
回攻員
String
:這位聯絡人的工作傳真號碼或空白字串 (如果沒有的話)
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
getWorkPhone()
getWorkPhone()
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
取得此聯絡人的工作電話號碼或空白字串 (如果沒有)。
回攻員
String
:這位聯絡人的工作電話號碼或空白字串 (如果沒有)
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
removeFromGroup(group)
removeFromGroup(group)
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
將這位聯絡人從指定聯絡人群組中移除。
// The code below gets all the contacts named "John Doe" and then removes each of them from // the "Work Friends" contact group var contacts = ContactsApp.getContactsByName('John Doe'); var group = ContactsApp.getContactGroup('Work Friends'); for (var i in contacts) { contacts[i] = contacts[i].removeFromGroup(group); }
參數
名稱 | 類型 | 說明 |
---|---|---|
group |
| 要將這位聯絡人從哪個聯絡人群組中移除 |
回攻員
— 這位聯絡人Contact
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
另請參閱
setFamilyName(familyName)
setFamilyName(familyName)
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
設定聯絡人的姓氏。
// The code below changes the family name of all the contacts whose names are "John Doe" // to "Doe-Smith" var contacts = ContactsApp.getContactsByName('John Doe'); for (var i in contacts) { contacts[i].setFamilyName('Doe-Smith'); }
參數
名稱 | 類型 | 說明 |
---|---|---|
familyName | String | 聯絡人的新姓氏 |
回攻員
— 這位聯絡人Contact
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
另請參閱
setFullName(fullName)
setFullName(fullName)
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
設定聯絡人的全名 (提供姓名和姓氏)。
// The code below changes the full name of all the contacts whose names are "John Doe" // to "Johnny Doe" var contacts = ContactsApp.getContactsByName('John Doe'); for (var i in contacts) { contacts[i].setFullName('Johnny Doe'); }
參數
名稱 | 類型 | 說明 |
---|---|---|
fullName | String | 聯絡人的新全名 |
回攻員
— 這位聯絡人Contact
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
另請參閱
setGivenName(givenName)
setGivenName(givenName)
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
設定聯絡人的名字。
// The code below changes the given name of all the contacts whose names are "John Doe" // to "Johnny" var contacts = ContactsApp.getContactsByName('John Doe'); for (var i in contacts) { contacts[i].setGivenName('Johnny'); }
參數
名稱 | 類型 | 說明 |
---|---|---|
givenName | String | 聯絡人的新名字 |
回攻員
— 這位聯絡人Contact
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
另請參閱
setHomeAddress(addr)
setHomeAddress(addr)
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
設定這位聯絡人的住家地址。
參數
名稱 | 類型 | 說明 |
---|---|---|
addr | String | 要設定的住家地址 |
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
setHomeFax(phone)
setHomeFax(phone)
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
設定這位聯絡人的住家傳真號碼。
參數
名稱 | 類型 | 說明 |
---|---|---|
phone | String | 要設定的住家傳真號碼 |
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
setHomePhone(phone)
setHomePhone(phone)
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
設定這位聯絡人的住家電話號碼。
參數
名稱 | 類型 | 說明 |
---|---|---|
phone | String | 要設定的住家電話號碼。 |
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
setInitials(initials)
setInitials(initials)
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
設定聯絡人的姓名縮寫。
// The code below sets the initials of all the contacts whose names are "Johnathan Doe" // to "JD" var contacts = ContactsApp.getContactsByName('Johnathan Doe'); for (var i in contacts) { contacts[i].setInitials('JD'); }
參數
名稱 | 類型 | 說明 |
---|---|---|
initials | String | 聯絡人的新姓名縮寫 |
回攻員
— 這位聯絡人Contact
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
另請參閱
setMaidenName(maidenName)
setMaidenName(maidenName)
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
設定聯絡人的婚前姓名。
// The code below changes the maiden name of all the contacts whose names are "Jane Doe" // to "Smith" var contacts = ContactsApp.getContactsByName('Jane Doe'); for (var i in contacts) { contacts[i].setMaidenName('Smith'); }
參數
名稱 | 類型 | 說明 |
---|---|---|
maidenName | String | 聯絡人的新娘家姓名 |
回攻員
— 這位聯絡人Contact
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
另請參閱
setMiddleName(middleName)
setMiddleName(middleName)
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
設定聯絡人的中間名稱。
// The code below changes the middle name of all the contacts whose names are "John Doe" // to "Danger" var contacts = ContactsApp.getContactsByName('John Doe'); for (var i in contacts) { contacts[i].setMiddleName('Danger'); }
參數
名稱 | 類型 | 說明 |
---|---|---|
middleName | String | 聯絡人的新中間姓名 |
回攻員
— 這位聯絡人Contact
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
另請參閱
setMobilePhone(phone)
setMobilePhone(phone)
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
設定這位聯絡人的手機號碼。
參數
名稱 | 類型 | 說明 |
---|---|---|
phone | String | 要設定的手機號碼 |
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
setNickname(nickname)
setNickname(nickname)
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
設定聯絡人的暱稱。
// The code below changes the nickname of all the contacts whose names are "John Doe" // to "JohnnyD" var contacts = ContactsApp.getContactsByName('John Doe'); for (var i in contacts) { contacts[i].setNickname('JohnnyD'); }
參數
名稱 | 類型 | 說明 |
---|---|---|
nickname | String | 聯絡人的新暱稱 |
回攻員
— 這位聯絡人Contact
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
另請參閱
setNotes(notes)
setNotes(notes)
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
設定與這位聯絡人相關的附註。
// The code below sets the notes of all the contacts whose names are "John Doe" // to "Met him at the hackathon" var contacts = ContactsApp.getContactsByName('John Doe'); for (var i in contacts) { contacts[i].setNotes('Met him at the hackathon'); }
參數
名稱 | 類型 | 說明 |
---|---|---|
notes | String | 要儲存這位聯絡人的記事 |
回攻員
— 這位聯絡人Contact
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
另請參閱
setPager(phone)
setPager(phone)
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
設定這位聯絡人的呼叫器編號。
參數
名稱 | 類型 | 說明 |
---|---|---|
phone | String | 要設定的呼叫器號碼 |
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
setPrefix(prefix)
setPrefix(prefix)
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
將前置字串設為聯絡人名稱。
// The code below sets the prefix of all the contacts whose names are "Johnathan Doe" // to "Mr" var contacts = ContactsApp.getContactsByName('Johnathan Doe'); for (var i in contacts) { contacts[i].setPrefix('Mr'); }
參數
名稱 | 類型 | 說明 |
---|---|---|
prefix | String | 聯絡人姓名的新前置字元 |
回攻員
— 這位聯絡人Contact
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
另請參閱
setPrimaryEmail(primaryEmail)
setPrimaryEmail(primaryEmail)
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
設定這位聯絡人的主要電子郵件地址。
參數
名稱 | 類型 | 說明 |
---|---|---|
primaryEmail | String | 要設定的主要電子郵件地址 |
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
setShortName(shortName)
setShortName(shortName)
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
設定聯絡人的簡稱。
// The code below changes the short name of all the contacts whose names are "Johnathan Doe" // to "John" var contacts = ContactsApp.getContactsByName('Johnathan Doe'); for (var i in contacts) { contacts[i].setShortName('John'); }
參數
名稱 | 類型 | 說明 |
---|---|---|
shortName | String | 聯絡人的新簡稱 |
回攻員
— 這位聯絡人Contact
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
另請參閱
setSuffix(suffix)
setSuffix(suffix)
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
將後置字串設為聯絡人名稱。
// The code below sets the suffix of all the contacts whose names are "Johnathan Doe" // to "Jr" var contacts = ContactsApp.getContactsByName('Johnathan Doe'); for (var i in contacts) { contacts[i].setSuffix('Jr'); }
參數
名稱 | 類型 | 說明 |
---|---|---|
suffix | String | 聯絡人姓名的新後置字串 |
回攻員
— 這位聯絡人Contact
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
另請參閱
setUserDefinedField(key, value)
setUserDefinedField(key, value)
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
設定此聯絡人定義的單一使用者欄位,用指定的鍵儲存。
參數
名稱 | 類型 | 說明 |
---|---|---|
key | String | 鍵可以是任何基本類型 (字串、 int 等) |
value | String | 這個值可以是任何基本類型 (字串、 int 等) |
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
setUserDefinedFields(o)
setUserDefinedFields(o)
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
設定此聯絡人的使用者定義的欄位,以及指定物件的屬性。
參數
名稱 | 類型 | 說明 |
---|---|---|
o | Object | 具有一或多個屬性,格式為 {key: value} 的物件 |
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
setWorkAddress(addr)
setWorkAddress(addr)
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
設定這位聯絡人的公司地址。
參數
名稱 | 類型 | 說明 |
---|---|---|
addr | String | 要設定的公司地址 |
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
setWorkFax(phone)
setWorkFax(phone)
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
設定這位聯絡人的工作傳真號碼。
參數
名稱 | 類型 | 說明 |
---|---|---|
phone | String | 要設定的公司傳真號碼 |
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds
setWorkPhone(phone)
setWorkPhone(phone)
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
設定這位聯絡人的公司電話號碼。
參數
名稱 | 類型 | 說明 |
---|---|---|
phone | String | 要設定的公司電話號碼。 |
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://www.google.com/m8/feeds