method addToGroup(contactGroup)
| サンプル : |
var group = ContactsApp.createContactGroup("Pets");
var contact = ContactsApp.createContact('Fido','McDog', 'fido@example.com');
contact.addToGroup(group);
|
| サンプル : |
var c = ContactsApp.createContact('Fido','McDog', 'fido@example.com');
var contact = ContactsApp.findByEmailAddress('fido@example.com');
contact.deleteContact();
|
method getEmailAddresses()
| 戻り値 : |
| Type | 説明 |
|
String [ ] |
指定した連絡先のメールアドレス
|
method getFamilyName()
| 戻り値 : |
| Type | 説明 |
|
String |
連絡先の家族名(姓)
|
method getFullName()
| 戻り値 : |
| Type | 説明 |
|
String |
連絡先のフルネーム
|
| サンプル : |
var c = ContactsApp.createContact('Fido','McDog', 'fido@example.com');
var contact = ContactsApp.findByEmailAddress('fido@example.com');
Browser.msgBox (contact.getFullName());
|
method getGivenName()
| 戻り値 : |
| Type | 説明 |
|
String |
連絡先の名前
|
method getHomeAddress()
| 戻り値 : |
| Type | 説明 |
|
String |
連絡先の自宅住所
|
method getHomeFax()
| 戻り値 : |
| Type | 説明 |
|
String |
連絡先の自宅ファックス番号
|
method getHomePhone()
| 戻り値 : |
| Type | 説明 |
|
String |
連絡先の自宅電話番号
|
method getMaidenName()
| 戻り値 : |
| Type | 説明 |
|
String |
連絡先の旧姓
|
method getMiddleName()
| 戻り値 : |
| Type | 説明 |
|
String |
連絡先のミドルネーム
|
method getMobilePhone()
| 戻り値 : |
| Type | 説明 |
|
String |
連絡先の携帯電話番号
|
method getNickname()
| 戻り値 : |
| Type | 説明 |
|
String |
連絡先のニックネーム
|
method getNotes()
| 戻り値 : |
| Type | 説明 |
|
String |
連絡先に関連のあるメモ
|
| 戻り値 : |
| Type | 説明 |
|
String |
連絡先のポケットベル番号
|
method getPrimaryEmail()
| 戻り値 : |
| Type | 説明 |
|
String |
連絡先のメインのメールアドレス
|
method getUserDefinedField(key)
| Arguments : |
| name | Type | 説明 |
|
key | var |
キーは任意の基本型を指定できる |
| 戻り値 : |
| Type | 説明 |
|
var |
前もってキーとともに格納された定義済コンテンツをユーザーに返す
|
| サンプル : |
var contact = ContactsApp.findByEmailAddress('fido@example.com');
var breed = contact.getUserDefinedField("Breed");
Browser.msgBox("Fido is a " + breed);
|
method getUserDefinedFields()
| 戻り値 : |
| Type | 説明 |
|
Object |
ユーザーが定義したキーその他に対応した名前を持つプロパティオブジェクト
|
| サンプル : |
// assumes you have run the setUserDefinedFields demo
var c = ContactsApp.findByEmailAddress('fido@example.com');
var properties = c.getUserDefinedFields();
for (var i in properties)
Browser.msgBox(i + ": " + properties[i]);
|
method getWorkAddress()
| 戻り値 : |
| Type | 説明 |
|
String |
この連絡先の職場の住所を含む文字列
|
method getWorkFax()
| 戻り値 : |
| Type | 説明 |
|
String |
この連絡先の職場のファックス番号を含む文字列
|
method getWorkPhone()
| 戻り値 : |
| Type | 説明 |
|
String |
この連絡先の職場の電話番号を含む文字列
|
method removeFromGroup(contactGroup)
| Arguments : |
| name | Type | 説明 |
|
contactGroup | ContactGroup |
削除しようとする連絡先の所属する連絡先グループ |
| サンプル : |
var contact = ContactsApp.findByEmailAddress('fido@example.com');
var group = ContactsApp.findContactGroup("Pets");
contact.removeFromGroup(group);
|
method setFamilyName(familyName)
| Arguments : |
| name | Type | 説明 |
|
familyName | String |
連絡先の家族名(姓) |
method setFullName(fullName)
| Arguments : |
| name | Type | 説明 |
|
fullName | String |
連絡先のフルネーム |
method setGivenName(givenName)
| Arguments : |
| name | Type | 説明 |
|
givenName | String |
指定された連絡先の名前 |
method setHomeAddress(homeAddress)
| Arguments : |
| name | Type | 説明 |
|
homeAddress | String |
連絡先の新しい自宅住所 |
method setHomeFax(homeFax)
| Arguments : |
| name | Type | 説明 |
|
homeFax | String |
連絡先の新しいファックス番号 |
method setHomePhone(homePhone)
| Arguments : |
| name | Type | 説明 |
|
homePhone | String |
連絡先の新しい自宅電話番号 |
method setMaidenName(maidenName)
| Arguments : |
| name | Type | 説明 |
|
maidenName | String |
連絡先の旧姓 |
method setMiddleName(middleName)
| Arguments : |
| name | Type | 説明 |
|
middleName | String |
連絡先のミドルネーム |
method setMobilePhone(mobilePhone)
| Arguments : |
| name | Type | 説明 |
|
mobilePhone | String |
連絡先の携帯電話番号 |
method setNickname(nickname)
| Arguments : |
| name | Type | 説明 |
|
nickname | String |
連絡先のニックネーム |
method setNotes(notes)
| Arguments : |
| name | Type | 説明 |
|
notes | String |
ノートはこの連絡先と一緒に格納される |
| Arguments : |
| name | Type | 説明 |
|
pager | String |
連絡先のポケットベル番号 |
method setPrimaryEmail(emailAddress)
| Arguments : |
| name | Type | 説明 |
|
emailAddress | String |
連絡先の新しいメインのメールアドレス |
method setUserDefinedField(key, value)
| Arguments : |
| name | Type | 説明 |
|
key | var |
キーは任意の基本型(文字列、整数、等)にすることができる |
|
value | var |
値は任意の基本型(文字列、整数、等)することができる |
| サンプル : |
var contact = ContactsApp.findByEmailAddress('fido@example.com');
contact.setUserDefinedField("Breed", "Irish Wolf Hound");
|
method setUserDefinedFields(obj)
| Arguments : |
| name | Type | 説明 |
|
obj | Object |
フォーム(キー:値)の1つまたは複数のプロパティを持つオブジェクト |
| サンプル : |
var properties = {};
properties.weight = 50;
properties.color = "Brown";
properties.breed = "Great Dane";
var c = ContactsApp.createContact('Fido','McDog', 'fido@example.com');
c.setUserDefinedFields(properties);
var breed = c.getUserDefinedField("breed");
Browser.msgBox("Fido is a " + breed);
|
method setWorkAddress(workAddress)
| Arguments : |
| name | Type | 説明 |
|
workAddress | String |
連絡先の職場の住所 |
method setWorkFax(workFax)
| Arguments : |
| name | Type | 説明 |
|
workFax | String |
連絡先の職場のファックス番号 |
method setWorkPhone(workPhone)
| Arguments : |
| name | Type | 説明 |
|
workPhone | String |
連絡先の職場の電話番号 |
| 動作確認用サンプル :
下のSetContactInfo()実行後にlookUpContactInfo()を行いました。
SetContactInfo()実行後のイメージと見比べてみると幾つかのメソッドは対応していないようです。英語版用なのかもしれませんが、
これだけあれば十分ですね。
|
function lookUpContactInfo(){
var contact = ContactsApp.findByEmailAddress('new@example.com');
for(var i in contact){
contact.getFullName();
}
var fullname = contact.getFullName();
var sheet = SpreadsheetApp.getActiveSheet().getRange("C4");
sheet.setValue(fullname);
var familyname = contact.getFamilyName();
var fullname = contact.getFullName();
var givenname = contact.getGivenName();
var homeaddress = contact.getHomeAddress();
var homefax = contact.getHomeFax();
var homephone = contact.getHomePhone();
var maidenname = contact.getMaidenName();
var middlename = contact.getMiddleName();
var mobilephone= contact.getMobilePhone();
var nickname = contact.getNickname();
var notes = contact.getNotes();
var pager = contact.getPager();
var primaryemail = contact.getPrimaryEmail();
var workaddress = contact.getWorkAddress();
var workfax = contact.getWorkFax();
var workphone = contact.getWorkPhone();
Browser.msgBox (familyname + fullname + givenname + homeaddress + homefax + homephone + maidenname + middlename );
Browser.msgBox (mobilephone + nickname + notes + pager + primaryemail + workaddress + workfax + workphone);
}
function SetContactInfo(){
var c = ContactsApp.findByEmailAddress('new@example.com');
c.setFamilyName("setFamilyName");
c.setFullName("setFullName");
c.setGivenName("setGivenName");
c.setHomeAddress("setHomeAddress");
c.setHomeFax("setHomeFax");
c.setHomePhone("setHomePhone");
c.setMaidenName("setMaidenName");
c.setMiddleName("setMiddleName");
c.setMobilePhone("setMobilePhone");
c.setNickname("setNickname");
c.setNotes("setNotes");
c.setPager("setPager");
c.setPrimaryEmail("setPrimaryEmail");
c.setWorkAddress("setWorkAddress");
c.setWorkFax("setWorkFax");
c.setWorkPhone("setWorkPhone");
}
|
20110128
|