回答編集履歴
1
修正
answer
CHANGED
@@ -39,11 +39,13 @@
|
|
39
39
|
const attachments = message.getAttachments();
|
40
40
|
const mailAddress = message.getFrom().replace(/^.+<([^>]+)>$/, '$1');
|
41
41
|
const contacts = ContactsApp.getContactsByEmailAddress(mailAddress);
|
42
|
-
const name = contacts[0].getFullName()
|
42
|
+
const name = contacts[0].getFullName()
|
43
43
|
|
44
44
|
for(const attachment of attachments){
|
45
|
-
folder.createFile(attachment)
|
45
|
+
const file = folder.createFile(attachment);
|
46
|
+
const newFileName = '[送信者名:' + name + ']' + file.getName();
|
47
|
+
file.setName(newFileName);
|
46
|
-
Logger.log('ファイル名「' +
|
48
|
+
Logger.log('ファイル名「' + newFileName + '」をフォルダに作成しました。')
|
47
49
|
}
|
48
50
|
}
|
49
51
|
}
|