我对谷歌脚本完全陌生,我正试图找出如何标记我已标记为“R / R(短)/ R(ASAP)”的消息,并且至少保留了该标签一天。有什么建议?这是我到目前为止所得到的:
function star2do() {
var delayDays = 1 // Enter # of days before messages are starred
var maxDate = new Date();
maxDate.setDate(maxDate.getDate()-delayDays);
var label = GmailApp.getUserLabelByName("R/R(short)/R(ASAP)");
var threads = label.getThreads();
for (var i = 0; i < threads.length; i++) {
if (threads[i].getLastMessageDate()<maxDate)
{
threads[i].markUnread();
threads[i].addLabel(star) //this is where I'm having issues
}
}
}
答案 0 :(得分:3)
threads[i].getMessages()[0].markUnread().star();
希望这会有所帮助:)