我对 Google Script 完全陌生,我正在尝试找出如何为我标记为“R/R(short)/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
}
}
}