非推奨。代わりに、People API アドバンスト サービスを使用してください。
連絡先には、連絡先の名前、住所、さまざまな連絡先情報が含まれます。
サポート終了のメソッド
メソッド | 戻り値の型 | 概要 |
---|---|---|
|
| 標準ラベルまたはカスタムラベルを使用して、連絡先にアドレスを追加します。 |
|
| 連絡先に会社を追加します。 |
|
| 拡張ラベルまたはカスタムラベルを使用して、連絡先にカスタム フィールドを追加します。 |
|
| 標準ラベルまたはカスタムラベルを使用して、連絡先に日付を追加します。 |
|
| 標準ラベル(自宅、職場など)またはカスタムラベルを使用してメールアドレスを追加します
{@code // 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. |
|
| 標準ラベルまたはカスタムラベルを使用して、連絡先に IM アドレスを追加します。 |
|
| 標準ラベルまたはカスタムラベルを使用して、連絡先に電話番号を追加します。 |
|
| この連絡先を指定された連絡先グループに追加します。 |
|
| 標準ラベルまたはカスタムラベルを使用して、連絡先に URL を追加します。 |
| void | この連絡先を削除します。 |
|
| この連絡先のすべてのアドレスを取得します。 |
|
| 特定のフィールドに一致する、この連絡先のすべての住所を取得します。 |
|
| この連絡先のすべての会社を取得します。 |
|
| この連絡先を含むすべての連絡先グループを取得します。 |
|
| この連絡先のすべてのカスタム フィールドを取得します。 |
|
| 特定のフィールドに一致する、この連絡先のカスタム項目をすべて取得します。 |
|
| この連絡先のすべての日付を取得します。 |
|
| 特定のフィールドに一致するこの連絡先のすべての日付を取得します。 |
| String[] | この連絡先で使用可能なメールアドレスのリストを取得します。 |
|
| この連絡先のメールアドレスを取得します。 |
|
| 特定のフィールドに一致するこの連絡先のメールアドレスを取得します。 |
| String | 連絡先の姓を文字列として取得します。 |
| String | 連絡先のフルネーム(名と姓)を文字列として取得します。 |
| String | 連絡先の名前(名)を文字列として取得します。 |
| String | この連絡先の自宅住所を取得します。住所が存在しない場合は空の文字列を返します。 |
| String | この連絡先の自宅 FAX 番号を取得します。番号が存在しない場合は空の文字列を返します。 |
| String | この連絡先の自宅の電話番号を取得します。番号が存在しない場合は空の文字列を返します。 |
|
| この連絡先のすべての IM アドレスを取得します。 |
|
| 特定のフィールドに一致する、この連絡先のすべての IM アドレスを取得します。 |
| String | この連絡先の一意の ID を返します。 |
| String | 連絡先のイニシャルを取得します。 |
| Date | この連絡先が最後に更新された日付を取得します。 |
| String | 連絡先の旧姓を文字列として取得します。 |
| String | 連絡先のミドルネームを文字列として取得します。 |
| String | この連絡先の携帯電話番号を取得します。番号が存在しない場合は空の文字列を返します。 |
| String | 連絡先のニックネームを文字列として取得します。 |
| String | この連絡先に関連付けられているメモを取得します。メモがない場合、空の文字列を返します。 |
| String | この連絡先のページャーの電話番号を取得します。存在しない場合は空の文字列を返します。 |
|
| この連絡先のすべての電話番号を取得します。 |
|
| 特定のフィールドに一致する、この連絡先のすべての電話番号を取得します。 |
| String | 連絡先の名前の接頭辞を取得します。 |
| String | 連絡先のメインのメールアドレスを文字列として取得します。 |
| String | 連絡先の短い名前を文字列として取得します。 |
| String | 連絡先の名前の接尾辞を取得します。 |
|
| この連絡先のすべての URL を取得します。 |
|
| 特定のフィールドに一致するこの連絡先のすべての URL を取得します。 |
| String | 指定されたキーに関連付けられたユーザー定義値を取得します。 |
| Object | この連絡先のすべてのユーザー定義フィールドを取得し、JavaScript オブジェクトのプロパティとして返します。 |
| String | この連絡先の職場の住所を取得します。存在しない場合は空の文字列を返します。 |
| String | この連絡先の仕事用ファックス番号を取得します。存在しない場合は空の文字列を返します。 |
| String | この連絡先の仕事用電話番号を取得します。電話番号が存在しない場合は空の文字列を返します。 |
|
| 指定した連絡先グループからこの連絡先を削除します。 |
|
| 連絡先の姓を設定します。 |
|
| 連絡先のフルネーム(名と姓)を設定します。 |
|
| 連絡先の名前(名)を設定します。 |
| void | この連絡先の自宅の住所を設定します。 |
| void | この連絡先の自宅 FAX 番号を設定します。 |
| void | この連絡先の自宅電話番号を設定します。 |
|
| 連絡先のイニシャルを設定します。 |
|
| 連絡先の旧姓を設定します。 |
|
| 連絡先のミドルネームを設定します。 |
| void | この連絡先の携帯電話番号を設定します。 |
|
| 連絡先のニックネームを設定します。 |
|
| この連絡先に関連付けられたメモを設定します。 |
| void | この連絡先のページャー番号を設定します。 |
|
| 連絡先の名前に接頭辞を設定します。 |
| void | この連絡先のメインのメールアドレスを設定します。 |
|
| 連絡先の略称を設定します。 |
|
| 連絡先の名前に接尾辞を設定します。 |
| void | この連絡先に 1 つのユーザー定義フィールドを設定し、指定されたキーで保存します。 |
| void | この連絡先のユーザー定義フィールドを、指定されたオブジェクトのプロパティで設定します。 |
| void | この連絡先の職場の住所を設定します。 |
| void | この連絡先の勤務先 FAX 番号を設定します。 |
| void | この連絡先の仕事用電話番号を設定します。 |
サポート終了のメソッド
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 ContactsApp.Field.WORK_ADDRESS // label. const contacts = ContactsApp.getContactsByName('John Doe'); const address = contacts[0].addAddress( ContactsApp.Field.WORK_ADDRESS, '123 Main St, Some City, NY 10011', );
パラメータ
名前 | 型 | 説明 |
---|---|---|
label | Object | 新しい住所のラベル(ContactsApp.Field またはカスタム文字列) |
address | String | 新しい住所 |
戻る
- 新しく作成されたフィールドAddress
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
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". const contacts = ContactsApp.getContactsByName('John Doe'); const url = contacts[0].addCompany('Google', 'Product Manager');
パラメータ
名前 | 型 | 説明 |
---|---|---|
company | String | この連絡先に追加する会社の名前 |
title | String | この会社でこの連絡先に関連付けられている役職 |
戻る
- 新しく作成されたフィールドCompany
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
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'. const contacts = ContactsApp.getContactsByName('John Doe'); contacts[0].addCustomField(ContactsApp.ExtendedField.HOBBY, 'hiking');
パラメータ
名前 | 型 | 説明 |
---|---|---|
label | Object | 新しい住所のラベル(ContactsApp.ExtendedField またはカスタム文字列) |
content | Object | カスタム フィールドに格納する値 |
戻る
- 新しく作成されたフィールドCustom
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
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". const contacts = ContactsApp.getContactsByName('John Doe'); const birthday = contacts[0].addDate( ContactsApp.Field.BIRTHDAY, ContactsApp.Month.APRIL, 19, 1950, );
パラメータ
名前 | 型 | 説明 |
---|---|---|
label | Object | 新しい日付のラベル(ContactsApp.Field またはカスタム文字列) |
month | Month | ContactApps.Month の月 |
day | Integer | 日 |
year | Integer | 年 |
戻る
- 新しく作成された日付Date
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
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. const contacts = ContactsApp.getContactsByName('John Doe'); const emailField = contacts[0].addEmail( ContactsApp.Field.HOME_EMAIL, 'j.doe@example.com', );
パラメータ
名前 | 型 | 説明 |
---|---|---|
label | Object | 新しいメールのラベル(ContactsApp.Field またはカスタム文字列) |
address | String | 新しいメールアドレス |
戻る
- 新しく追加されたフィールドEmail
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
addIM(label, address)
addIM(label, address)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
標準ラベルまたはカスタムラベルを使用して、連絡先に IM アドレスを追加します。
ラベルは、ContactsApp.Field またはカスタムラベル文字列のいずれかです。
// The code below retrieves a contact named "John Doe" and adds the IM address // "ChatWithJohn" with the ContactsApp.Field.AIM label. const contacts = ContactsApp.getContactsByName('John Doe'); const email = contacts[0].addIM(ContactsApp.Field.AIM, 'ChatWithJohn');
パラメータ
名前 | 型 | 説明 |
---|---|---|
label | Object | 新しい IM アドレスのラベル(ContactsApp.Field またはカスタム文字列) |
address | String | 新しい IM アドレス |
戻る
- 新しく作成されたフィールドIMField
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
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 ContactsApp.Field.WORK_PHONE label. const contacts = ContactsApp.getContactsByName('John Doe'); const phone = contacts[0].addPhone( ContactsApp.Field.WORK_PHONE, '212-555-1234', );
パラメータ
名前 | 型 | 説明 |
---|---|---|
label | Object | 新しい電話番号のラベル(ContactsApp.Field またはカスタム文字列) |
number | String | 新しい電話番号 |
戻る
- 新しく作成されたフィールドPhone
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
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" let contact = ContactsApp.createContact('John', 'Doe', 'john.doe@example.com'); const group = ContactsApp.getContactGroup('Work Friends'); contact = contact.addToGroup(group);
パラメータ
名前 | 型 | 説明 |
---|---|---|
group |
| この連絡先を追加する連絡先グループ |
戻る
- この連絡先Contact
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
addUrl(label, url)
addUrl(label, url)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
標準ラベルまたはカスタムラベルを使用して、連絡先に URL を追加します。
ラベルは、ContactsApp.Field またはカスタムラベル文字列のいずれかです。
// The code below retrieves a contact named "John Doe" and adds the URL // "http://www.example.com" with the ContactsApp.Field.WORK_WEBSITE label. const contacts = ContactsApp.getContactsByName('John Doe'); const url = contacts[0].addUrl( ContactsApp.Field.WORK_WEBSITE, 'http://www.example.com', );
パラメータ
名前 | 型 | 説明 |
---|---|---|
label | Object | 新しい住所のラベル(ContactsApp.Field またはカスタム文字列) |
url | String | 新しい URL |
戻る
- 新しく作成されたフィールドUrl
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
deleteContact()
deleteContact()
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
この連絡先を削除します。
const contacts = ContactsApp.getContactsByName('John Doe'); for (const i in contacts) { contacts[i].deleteContact(); }
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
getAddresses()
getAddresses()
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
この連絡先のすべてのアドレスを取得します。
// The code below logs the addresses of all the contacts whose names contain // "John Doe" const contacts = ContactsApp.getContactsByName('John Doe'); for (const i in contacts) { Logger.log(contacts[i].getAddresses()); }
戻る
- アドレスのリストAddress
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
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. const contacts = ContactsApp.getContactsByName('John Doe'); const addresses = contacts[0].getAddresses(ContactsApp.Field.WORK_ADDRESS); for (const i in addresses) { Logger.log(addresses[i].getAddress()); }
パラメータ
名前 | 型 | 説明 |
---|---|---|
label | Object | 一致させるラベル(ContactsApp.Field またはカスタム文字列) |
戻る
- アドレスのリストAddress
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
getCompanies()
getCompanies()
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
この連絡先のすべての会社を取得します。
// The code below logs the company names of all the contacts whose names contain // "John Doe" const contacts = ContactsApp.getContactsByName('John Doe'); for (const i in contacts) { const companies = contacts[i].getCompanies(); for (const j in companies) { Logger.log(companies[j].getCompanyName()); } }
戻る
- 企業のリストCompany
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
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 const contacts = ContactsApp.getContactsByName('John Doe'); const groups = contacts[0].getContactGroups();
戻る
- この連絡先を含むグループContact
関連情報
getCustomFields()
getCustomFields()
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
この連絡先のすべてのカスタム フィールドを取得します。
// The code below retrieves a contact named "John Doe" and logs the custom // fields associated with that contact const contacts = ContactsApp.getContactsByName('John Doe'); const fields = contacts[0].getCustomFields(); for (const i in fields) { Logger.log(fields[i].getValue()); }
戻る
- カスタム フィールドのリストCustom
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
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. const contacts = ContactsApp.getContactsByName('John Doe'); const hobbies = contacts[0].getCustomFields(ContactsApp.ExtendedField.HOBBY); for (const i in hobbies) { Logger.log(hobbies[i].getValue()); }
パラメータ
名前 | 型 | 説明 |
---|---|---|
label | Object | 一致させるラベル(ContactsApp.ExtendedField またはカスタム文字列) |
戻る
- カスタム フィールドのリストCustom
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
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 const contacts = ContactsApp.getContactsByName('John Doe'); const dates = contacts[0].getDates(); for (const i in dates) { Logger.log(dates[i].getLabel()); }
戻る
- 日付のリストDate
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
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. const contacts = ContactsApp.getContactsByName('John Doe'); const birthdays = contacts[0].getDates(ContactsApp.Field.BIRTHDAY); for (const i in birthdays) { Logger.log(birthdays[i].getDay()); }
パラメータ
名前 | 型 | 説明 |
---|---|---|
label | Object | 一致させるラベル(ContactsApp.Field またはカスタム文字列) |
戻る
- 日付のリストDate
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
getEmailAddresses()
getEmailAddresses()
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
この連絡先で使用可能なメールアドレスのリストを取得します。
戻る
String[]
- この連絡先で使用可能なメールアドレスのリスト
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
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 const contacts = ContactsApp.getContactsByName('John Doe'); const emails = contacts[0].getEmails(); for (const i in emails) { Logger.log(emails[i].getAddress()); }
戻る
- 連絡先のメールアドレスのリストEmail
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
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. const contacts = ContactsApp.getContactsByName('John Doe'); const emails = contacts[0].getEmails(ContactsApp.Field.HOME_EMAIL); for (const i in emails) { Logger.log(emails[i].getAddress()); }
パラメータ
名前 | 型 | 説明 |
---|---|---|
label | Object | 一致させるラベル(ContactsApp.Field またはカスタム文字列) |
戻る
- 連絡先のメールアドレスのリストEmail
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
getFamilyName()
getFamilyName()
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
連絡先の姓を文字列として取得します。
// The code below logs the family name of all the contacts whose names contain // "John" const contacts = ContactsApp.getContactsByName('John'); for (const i in contacts) { Logger.log(contacts[i].getFamilyName()); }
戻る
String
- 連絡先の姓
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
getFullName()
getFullName()
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
連絡先のフルネーム(名と姓)を文字列として取得します。
// The code below logs the full name of all the contacts whose names contain // "John" const contacts = ContactsApp.getContactsByName('John'); for (const i in contacts) { Logger.log(contacts[i].getFullName()); }
戻る
String
- 連絡先のフルネーム
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
getGivenName()
getGivenName()
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
連絡先の名前(名)を文字列として取得します。
// The code below logs the given name of all the contacts whose names contain // "Smith" const contacts = ContactsApp.getContactsByName('Smith'); for (const i in contacts) { Logger.log(contacts[i].getGivenName()); }
戻る
String
- 連絡先の名前(名)
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
getHomeAddress()
getHomeAddress()
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
この連絡先の自宅住所を取得します。住所が存在しない場合は空の文字列を返します。
戻る
String
- この連絡先の自宅住所。存在しない場合は空の文字列
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
getHomeFax()
getHomeFax()
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
この連絡先の自宅 FAX 番号を取得します。番号が存在しない場合は空の文字列を返します。
戻る
String
- この連絡先の自宅 FAX 番号。存在しない場合は空の文字列
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
getHomePhone()
getHomePhone()
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
この連絡先の自宅の電話番号を取得します。電話番号が存在しない場合は空の文字列を返します。
戻る
String
- この連絡先の自宅電話番号。存在しない場合は空の文字列
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
getIMs()
getIMs()
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
この連絡先のすべての IM アドレスを取得します。
// The code below logs the IM addresses of all the contacts whose names contain // "John Doe" const contacts = ContactsApp.getContactsByName('John Doe'); for (const i in contacts) { Logger.log(contacts[i].getIMs()); }
戻る
- IM アドレスのリストIMField[]
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
getIMs(label)
getIMs(label)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
特定のフィールドに一致する、この連絡先のすべての IM アドレスを取得します。
ラベルは、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. const contacts = ContactsApp.getContactsByName('John Doe'); const imAddresses = contacts[0].getIMs(ContactsApp.Field.GOOGLE_TALK); for (const i in imAddresses) { Logger.log(imAddresses[i].getAddress()); }
パラメータ
名前 | 型 | 説明 |
---|---|---|
label | Object | 一致させるラベル(ContactsApp.Field またはカスタム文字列) |
戻る
- IM アドレスのリストIMField[]
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
getId()
getId()
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
この連絡先の一意の ID を返します。
const contact = ContactsApp.createContact( 'John', 'Doe', 'john.doe@example.com', ); const id = contact.getId();
戻る
String
- この連絡先の ID
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
getInitials()
getInitials()
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
連絡先のイニシャルを取得します。
// The code below logs the initials of all the contacts whose names contain // "John Doe" const contacts = ContactsApp.getContactsByName('John Doe'); for (const i in contacts) { Logger.log(contacts[i].getInitials()); }
戻る
String
- 連絡先のイニシャル
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
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" const contacts = ContactsApp.getContactsByName('John Doe'); for (const i in contacts) { Logger.log(contacts[i].getLastUpdated()); }
戻る
Date
- この連絡先が最後に更新された日付
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
getMaidenName()
getMaidenName()
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
連絡先の旧姓を文字列として取得します。
// The code below logs the maiden name of all the contacts whose names contain // "Jane" const contacts = ContactsApp.getContactsByName('Jane'); for (const i in contacts) { Logger.log(contacts[i].getMaidenName()); }
戻る
String
- 連絡先の旧姓
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
getMiddleName()
getMiddleName()
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
連絡先のミドルネームを文字列として取得します。
// The code below logs the middle name of all the contacts whose names contain // "Smith" const contacts = ContactsApp.getContactsByName('Smith'); for (const i in contacts) { Logger.log(contacts[i].getMiddleName()); }
戻る
String
- 連絡先のミドルネーム
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
getMobilePhone()
getMobilePhone()
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
この連絡先の携帯電話番号を取得します。番号が存在しない場合は空の文字列を返します。
戻る
String
- この連絡先の携帯電話番号。存在しない場合は空の文字列
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
getNickname()
getNickname()
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
連絡先のニックネームを文字列として取得します。
// The code below logs the nickname of all the contacts whose names contain // "John Doe" const contacts = ContactsApp.getContactsByName('John Doe'); for (const i in contacts) { Logger.log(contacts[i].getNickname()); }
戻る
String
- 連絡先のニックネーム
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
getNotes()
getNotes()
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
この連絡先に関連付けられているメモを取得します。メモがない場合、空の文字列を返します。
// The code below logs the notes of all the contacts whose names contain "John // Doe" const contacts = ContactsApp.getContactsByName('John Doe'); for (const i in contacts) { Logger.log(contacts[i].getNotes()); }
戻る
String
- この連絡先に関連付けられたメモ
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
getPager()
getPager()
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
この連絡先のページャーの電話番号を取得します。存在しない場合は空の文字列を返します。
戻る
String
- この連絡先のページャーの電話番号。存在しない場合は空の文字列
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
getPhones()
getPhones()
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
この連絡先のすべての電話番号を取得します。
// The code below logs the phone numbers of all the contacts whose names contain // "John Doe" const contacts = ContactsApp.getContactsByName('John Doe'); for (const i in contacts) { Logger.log(contacts[i].getPhones()); }
戻る
- 電話番号のリストPhone
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
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. const contacts = ContactsApp.getContactsByName('John Doe'); const phones = contacts[0].getPhones(ContactsApp.Field.WORK_PHONE); for (const i in phones) { Logger.log(phones[i].getPhoneNumber()); }
パラメータ
名前 | 型 | 説明 |
---|---|---|
label | Object | 一致させるラベル(ContactsApp.Field またはカスタム文字列) |
戻る
- 電話番号のリストPhone
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
getPrefix()
getPrefix()
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
連絡先の名前の接頭辞を取得します。
// The code below logs the prefix of all the contacts whose names contain "John // Doe" const contacts = ContactsApp.getContactsByName('John Doe'); for (const i in contacts) { Logger.log(contacts[i].getPrefix()); }
戻る
String
- 連絡先の名前の接頭辞
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
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" const contacts = ContactsApp.getContactsByName('John Doe'); for (const i in contacts) { Logger.log(contacts[i].getPrimaryEmail()); }
戻る
String
- 連絡先のメインのメールアドレス
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
getShortName()
getShortName()
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
連絡先の短い名前を文字列として取得します。
// The code below logs the short name of all the contacts whose names contain // "Johnathan" const contacts = ContactsApp.getContactsByName('Johnathan'); for (const i in contacts) { Logger.log(contacts[i].getShortName()); }
戻る
String
- 連絡先の省略名
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
getSuffix()
getSuffix()
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
連絡先の名前の接尾辞を取得します。
// The code below logs the suffix of all the contacts whose names contain "John // Doe" const contacts = ContactsApp.getContactsByName('John Doe'); for (const i in contacts) { Logger.log(contacts[i].getSuffix()); }
戻る
String
- 連絡先の名前の接尾辞
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
getUrls()
getUrls()
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
この連絡先のすべての URL を取得します。
// The code below logs the URLs of all the contacts whose names contain "John // Doe" const contacts = ContactsApp.getContactsByName('John Doe'); for (const i in contacts) { Logger.log(contacts[i].getUrls()); }
戻る
- URL のリストUrl
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
getUrls(label)
getUrls(label)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
特定のフィールドに一致するこの連絡先のすべての URL を取得します。
ラベルは、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. const contacts = ContactsApp.getContactsByName('John Doe'); const urls = contacts[0].getUrls(ContactsApp.Field.WORK_WEBSITE); for (const i in urls) { Logger.log(urls[i].getAddress()); }
パラメータ
名前 | 型 | 説明 |
---|---|---|
label | Object | 一致させるラベル(ContactsApp.Field またはカスタム文字列) |
戻る
- URL のリストUrl
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
getUserDefinedField(key)
getUserDefinedField(key)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
指定されたキーに関連付けられたユーザー定義値を取得します。
パラメータ
名前 | 型 | 説明 |
---|---|---|
key | String | キーには任意の基本型(String、int など)を指定できます。 |
戻る
String
- このキーで保存されたユーザー定義コンテンツ
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
getUserDefinedFields()
getUserDefinedFields()
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
この連絡先のすべてのユーザー定義フィールドを取得し、JavaScript オブジェクトのプロパティとして返します。
戻る
Object
- この連絡先のユーザー定義フィールド(JavaScript オブジェクトのプロパティとして)
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
getWorkAddress()
getWorkAddress()
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
この連絡先の職場の住所を取得します。存在しない場合は空の文字列を返します。
戻る
String
- この連絡先の職場の住所。存在しない場合は空の文字列
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
getWorkFax()
getWorkFax()
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
この連絡先のビジネス用ファックス番号を取得します。番号が存在しない場合は空の文字列を返します。
戻る
String
- この連絡先の職場の FAX 番号。存在しない場合は空の文字列
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
getWorkPhone()
getWorkPhone()
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
この連絡先の仕事用電話番号を取得します。電話番号が存在しない場合は空の文字列を返します。
戻る
String
- この連絡先の職場の電話番号。存在しない場合は空の文字列
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
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 const contacts = ContactsApp.getContactsByName('John Doe'); const group = ContactsApp.getContactGroup('Work Friends'); for (const i in contacts) { contacts[i] = contacts[i].removeFromGroup(group); }
パラメータ
名前 | 型 | 説明 |
---|---|---|
group |
| この連絡先を削除する連絡先グループ |
戻る
- この連絡先Contact
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
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" const contacts = ContactsApp.getContactsByName('John Doe'); for (const i in contacts) { contacts[i].setFamilyName('Doe-Smith'); }
パラメータ
名前 | 型 | 説明 |
---|---|---|
family | String | 連絡先の新しい姓 |
戻る
- この連絡先Contact
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
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" const contacts = ContactsApp.getContactsByName('John Doe'); for (const i in contacts) { contacts[i].setFullName('Johnny Doe'); }
パラメータ
名前 | 型 | 説明 |
---|---|---|
full | String | 連絡先の新しい氏名 |
戻る
- この連絡先Contact
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
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" const contacts = ContactsApp.getContactsByName('John Doe'); for (const i in contacts) { contacts[i].setGivenName('Johnny'); }
パラメータ
名前 | 型 | 説明 |
---|---|---|
given | String | 連絡先の新しい名前(名) |
戻る
- この連絡先Contact
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
setHomeAddress(addr)
setHomeAddress(addr)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
この連絡先の自宅の住所を設定します。
パラメータ
名前 | 型 | 説明 |
---|---|---|
addr | String | 設定する自宅の住所 |
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
setHomeFax(phone)
setHomeFax(phone)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
この連絡先の自宅 FAX 番号を設定します。
パラメータ
名前 | 型 | 説明 |
---|---|---|
phone | String | 設定する自宅の FAX 番号 |
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
setHomePhone(phone)
setHomePhone(phone)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
この連絡先の自宅電話番号を設定します。
パラメータ
名前 | 型 | 説明 |
---|---|---|
phone | String | 設定する自宅の電話番号 |
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
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" const contacts = ContactsApp.getContactsByName('Johnathan Doe'); for (const i in contacts) { contacts[i].setInitials('JD'); }
パラメータ
名前 | 型 | 説明 |
---|---|---|
initials | String | 連絡先の新しいイニシャル |
戻る
- この連絡先Contact
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
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" const contacts = ContactsApp.getContactsByName('Jane Doe'); for (const i in contacts) { contacts[i].setMaidenName('Smith'); }
パラメータ
名前 | 型 | 説明 |
---|---|---|
maiden | String | 連絡先の新しい旧姓 |
戻る
- この連絡先Contact
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
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" const contacts = ContactsApp.getContactsByName('John Doe'); for (const i in contacts) { contacts[i].setMiddleName('Danger'); }
パラメータ
名前 | 型 | 説明 |
---|---|---|
middle | String | 連絡先の新しいミドルネーム |
戻る
- この連絡先Contact
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
setMobilePhone(phone)
setMobilePhone(phone)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
この連絡先の携帯電話番号を設定します。
パラメータ
名前 | 型 | 説明 |
---|---|---|
phone | String | 設定する携帯電話番号 |
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
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" const contacts = ContactsApp.getContactsByName('John Doe'); for (const i in contacts) { contacts[i].setNickname('JohnnyD'); }
パラメータ
名前 | 型 | 説明 |
---|---|---|
nickname | String | 連絡先の新しいニックネーム |
戻る
- この連絡先Contact
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
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" const contacts = ContactsApp.getContactsByName('John Doe'); for (const i in contacts) { contacts[i].setNotes('Met him at the hackathon'); }
パラメータ
名前 | 型 | 説明 |
---|---|---|
notes | String | この連絡先に保存するメモ |
戻る
- この連絡先Contact
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
setPager(phone)
setPager(phone)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
この連絡先のページャー番号を設定します。
パラメータ
名前 | 型 | 説明 |
---|---|---|
phone | String | 設定するページャー番号 |
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
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" const contacts = ContactsApp.getContactsByName('Johnathan Doe'); for (const i in contacts) { contacts[i].setPrefix('Mr'); }
パラメータ
名前 | 型 | 説明 |
---|---|---|
prefix | String | 連絡先の名前の新しい接頭辞 |
戻る
- この連絡先Contact
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
setPrimaryEmail(primaryEmail)
setPrimaryEmail(primaryEmail)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
この連絡先のメインのメールアドレスを設定します。
パラメータ
名前 | 型 | 説明 |
---|---|---|
primary | String | 設定するメインのメールアドレス |
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
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" const contacts = ContactsApp.getContactsByName('Johnathan Doe'); for (const i in contacts) { contacts[i].setShortName('John'); }
パラメータ
名前 | 型 | 説明 |
---|---|---|
short | String | 連絡先の新しい略称 |
戻る
- この連絡先Contact
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
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" const contacts = ContactsApp.getContactsByName('Johnathan Doe'); for (const i in contacts) { contacts[i].setSuffix('Jr'); }
パラメータ
名前 | 型 | 説明 |
---|---|---|
suffix | String | 連絡先の名前の新しい接尾辞 |
戻る
- この連絡先Contact
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
setUserDefinedField(key, value)
setUserDefinedField(key, value)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
この連絡先に 1 つのユーザー定義フィールドを設定し、指定されたキーで保存します。
パラメータ
名前 | 型 | 説明 |
---|---|---|
key | String | キーには任意の基本型(String、int など)を指定できます。 |
value | String | 値は任意の基本型(String、int など)にできます。 |
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
setUserDefinedFields(o)
setUserDefinedFields(o)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
この連絡先のユーザー定義フィールドを、指定されたオブジェクトのプロパティで設定します。
パラメータ
名前 | 型 | 説明 |
---|---|---|
o | Object | {key: value} 形式の 1 つ以上のプロパティを持つオブジェクト |
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
setWorkAddress(addr)
setWorkAddress(addr)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
この連絡先の職場の住所を設定します。
パラメータ
名前 | 型 | 説明 |
---|---|---|
addr | String | 設定する職場の住所 |
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
setWorkFax(phone)
setWorkFax(phone)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
この連絡先の勤務先 FAX 番号を設定します。
パラメータ
名前 | 型 | 説明 |
---|---|---|
phone | String | 設定する職場の FAX 番号 |
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
setWorkPhone(phone)
setWorkPhone(phone)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
この連絡先の仕事用電話番号を設定します。
パラメータ
名前 | 型 | 説明 |
---|---|---|
phone | String | 設定する仕事用の電話番号 |
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds