サポート終了のメソッド
メソッド | 戻り値の型 | 概要 |
---|---|---|
|
| 指定した連絡先をこのグループに追加します
// The code below creates a new contact and adds it to the "Work Friends" // contact group const contact = ContactsApp.createContact( 'John', 'Doe', 'john.doe@example.com', ); const group = ContactsApp.getContactGroup('Work Friends'); group.addContact(contact); |
| void | この連絡先グループを削除します。 |
|
| この連絡先グループ内のすべての連絡先を取得します。 |
| String | このグループの名前を返します。 |
| String | この連絡先グループの ID を取得します。 |
| String | この連絡先グループの名前を取得します。 |
| Boolean | この連絡先グループがシステム グループ(削除不可)かどうかを判断するブール値を取得します。 |
|
| 指定した連絡先をこのグループから削除します
// The code below retrieves all the contacts named "John Doe' and removes them // from the "Work Friends" contact group const contacts = ContactsApp.getContactsByName('John Doe'); const group = ContactsApp.getContactGroup('Work Friends'); for (const i in contacts) { group.removeContact(contacts[i]); } |
| void | このグループの名前を設定します。 |
|
| この連絡先グループの名前を設定します。 |
サポート終了のメソッド
add Contact(contact)
add Contact(contact)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
指定した連絡先をこのグループに追加します
// The code below creates a new contact and adds it to the "Work Friends" // contact group const contact = ContactsApp.createContact( 'John', 'Doe', 'john.doe@example.com', ); const group = ContactsApp.getContactGroup('Work Friends'); group.addContact(contact);
パラメータ
名前 | 型 | 説明 |
---|---|---|
contact |
| グループに追加する連絡先 |
戻る
- この連絡先グループContact
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
delete Group()
delete Group()
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
この連絡先グループを削除します。
システム以外のグループのみを削除します。システム グループは削除できません。
// The code below retrieves a contact group named "Work Friends" and deletes it const group = ContactsApp.getContactGroup('Work Friends'); group.deleteGroup();
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
get Contacts()
get Contacts()
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
この連絡先グループ内のすべての連絡先を取得します。
// The code below retrieves all the contacts in the group named "Work Friends" const group = ContactsApp.getContactGroup('Work Friends'); const contacts = group.getContacts();
戻る
- このグループの連絡先Contact[]
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
get Group Name()
get Group Name()
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
このグループの名前を返します。
戻る
String
- このグループの名前
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
get Id()
get Id()
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
この連絡先グループの ID を取得します。
// The code below retrieves a contact group named "Work Friends" and gets its id const group = ContactsApp.getContactGroup('Work Friends'); const id = group.getId();
戻る
String
- このグループの ID
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
get Name()
get Name()
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
この連絡先グループの名前を取得します。
// The code below creates a new contact group and then retrieves its name const group = ContactsApp.createContactGroup('Work Friends'); const name = group.getName();
戻る
String
- この連絡先グループの名前
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
is System Group()
is System Group()
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
この連絡先グループがシステム グループ(削除不可)かどうかを判断するブール値を取得します。
システム グループは、Google コンタクトで事前定義された一連のグループです(「マイ コンタクト」、「家族」、「同僚」など)。システム グループの名前には通常、「システム グループ」という単語が含まれています。
// The code below retrieves two contact groups, then logs whether or not // each is a system group. const myGroup = ContactsApp.getContactGroup('Work Friends'); const systemGroup = ContactsApp.getContactGroup('System Group: Coworkers'); Logger.log(myGroup.isSystemGroup()); // Returns false, if the group exists. Logger.log(systemGroup.isSystemGroup()); // Returns true.
戻る
Boolean
- この連絡先グループがシステム グループかどうか
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
remove Contact(contact)
remove Contact(contact)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
指定した連絡先をこのグループから削除します
// The code below retrieves all the contacts named "John Doe' and removes them // from the "Work Friends" contact group const contacts = ContactsApp.getContactsByName('John Doe'); const group = ContactsApp.getContactGroup('Work Friends'); for (const i in contacts) { group.removeContact(contacts[i]); }
パラメータ
名前 | 型 | 説明 |
---|---|---|
contact |
| グループから削除する連絡先 |
戻る
- この連絡先グループContact
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
set Group Name(name)
set Group Name(name)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
このグループの名前を設定します。
パラメータ
名前 | 型 | 説明 |
---|---|---|
name | String | このグループに設定する名前 |
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
set Name(name)
set Name(name)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
この連絡先グループの名前を設定します。
// The code below retrieves the contact group named "Work Friends" and renames // it to "Work Buddies" const group = ContactsApp.getContactGroup('Work Friends'); group.setName('Work Buddies');
パラメータ
名前 | 型 | 説明 |
---|---|---|
name | String | 連絡先グループの新しい名前 |
戻る
- この連絡先グループContact
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds