Question about google apps script. I made a script to get some message from my gmail and insert the message into the spreadtheet.
function testFunction() {
var sheet = SpreadsheetApp.getActiveSheet();
var row = sheet.getLastRow() + 1;
var threadsNew = GmailApp.search('subject: XXXX', 0, 5);
for(var n in threadsNew){
var thdNew = threadsNew[n];
var msgsNew = thdNew.getMessages();
for(m in msgsNew){
var msgNew = msgsNew[m];
var bodyNew = msgNew.getBody();
sheet.getRange(row, 1 ).setValue(bodyNew);
row++
Utilities.sleep(1000);
}
}
}
Probrem : I'd like to get a series of email after removing reply-mail from thread, but GmailApp.search method gets all email include reply-mail.
Does Anybody have a good idea to remove reply-mail?