非推奨。代わりに、People API アドバンスト サービスを使用してください。
連絡先のインスタント メッセージ フィールド。
メソッド
メソッド | 戻り値の型 | 概要 |
---|---|---|
get | String | このフィールドのアドレスを取得します。 |
get | Object | このフィールドのラベルを取得します。 |
is | Boolean | これが主なフィールド値かどうかを取得します。 |
set |
| このフィールドのアドレスを設定します。 |
set |
| このフィールドをプライマリに設定します。 |
set |
| このフィールドのラベルを設定します。 |
set |
| このフィールドのラベルを設定します。 |
サポート終了のメソッド
メソッド | 戻り値の型 | 概要 |
---|---|---|
| void | このインスタント メッセージ フィールドを削除します。 |
詳細なドキュメント
getAddress()
このフィールドのアドレスを取得します。
// Logs the address for the 'Home Address' field for contact 'John Doe'.
// Can be used similarly for other fields that contain addresses.
const contacts = ContactsApp.getContactsByName('John Doe');
const homeAddress = contacts[0].getAddresses(ContactsApp.Field.HOME_ADDRESS);
Logger.log(homeAddress[0].getAddress());
戻る
String
- 住所(文字列)
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
getLabel()
このフィールドのラベルを取得します。これは、Field、ExtendedField、または String です。
// Logs the label for all the address fields associated with contact
// 'John Doe'. This method can be similarly called for any field that has
// a label.
const contacts = ContactsApp.getContactsByName('John Doe');
const addressFields = contacts[0].getAddresses();
for (let i = 0; i < addressFields.length; i++) {
Logger.log(addressFields[i].getLabel());
}
戻る
Object
- このフィールドのラベル
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
isPrimary()
これが主なフィールド値かどうかを取得します。
// Logs whether or not the first address field associated with contact
// 'John Doe' is labeled as primary. This method can be similarly called
// for any field.
const contacts = ContactsApp.getContactsByName('John Doe');
const addressFields = contacts[0].getAddresses();
Logger.log(addressFields[0].isPrimary());
戻る
Boolean
- プライマリかどうか
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
setAddress(address)
このフィールドのアドレスを設定します。
// Sets the address for the 'Home Address' field for contact 'John Doe'.
// Can be used similarly for other fields that contain addresses.
const contacts = ContactsApp.getContactsByName('John Doe');
const homeAddress = contacts[0].getAddresses(ContactsApp.Field.HOME_ADDRESS);
homeAddress[0].setAddress('123 Main St, Raleigh, NC, 27601');
パラメータ
名前 | 型 | 説明 |
---|---|---|
address | String | 新しい住所 |
戻る
- チェーンに便利なフィールドIMField
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
setAsPrimary()
このフィールドをプライマリに設定します。
// Sets the first address field associated with contact 'John Doe'
// as primary. This method can be similarly called for any field.
const contacts = ContactsApp.getContactsByName('John Doe');
const addressFields = contacts[0].getAddresses();
addressFields[0].setAsPrimary();
戻る
- チェーン用のこの FieldValueIMField
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
setLabel(field)
このフィールドのラベルを設定します。
// Sets the label to 'Work' for the first address field associated
// with contact 'John Doe'. This method can be similarly called for any
// field that has a label.
const contacts = ContactsApp.getContactsByName('John Doe');
const addressFields = contacts[0].getAddresses();
addressFields[0].setLabel(ContactsApp.Field.WORK_ADDRESS);
パラメータ
名前 | 型 | 説明 |
---|---|---|
field |
| 新しい標準ラベル |
戻る
- チェーン用のこの FieldValueIMField
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
setLabel(label)
このフィールドのラベルを設定します。
// Sets the label to 'Apartment' for the first address field associated
// with contact 'John Doe'. This method can be similarly called for any
// field that has a label.
const contacts = ContactsApp.getContactsByName('John Doe');
const addressFields = contacts[0].getAddresses();
addressFields[0].setLabel('Apartment');
パラメータ
名前 | 型 | 説明 |
---|---|---|
label | String | このフィールドの新しいラベル |
戻る
- チェーンに便利なフィールドIMField
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
サポート終了のメソッド
deleteIMField()
deleteIMField()
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
このインスタント メッセージ フィールドを削除します。
// Retrieves and deletes the AIM instant messaging field for contact 'John
// Doe'
const contacts = ContactsApp.getContactsByName('John Doe');
const imFields = contacts[0].getIMs(ContactsApp.Field.AIM);
imFields[0].deleteIMField();
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds