Google apps script 如何从时间驱动触发器中清除Gmail垃圾
我如何使用一个按特定时间间隔运行的脚本清除Gmail垃圾Google apps script 如何从时间驱动触发器中清除Gmail垃圾,google-apps-script,gmail,Google Apps Script,Gmail,我如何使用一个按特定时间间隔运行的脚本清除Gmail垃圾 // // A google app script for purgeing my gmail trash. // // It did work but is there a better way to do this ? // function delete_my_gmail_trash() { var threads = GmailApp.search( "in:trash" ); for ( var i =
//
// A google app script for purgeing my gmail trash.
//
// It did work but is there a better way to do this ?
//
function delete_my_gmail_trash() {
var threads = GmailApp.search( "in:trash" );
for ( var i = 0; i < threads.length; i++ ) {
num_of_messages_in_the_thread = threads[i].getMessageCount();
for ( var j = 0; j < num_of_messages_in_the_thread; j++ ) {
Gmail.Users.Messages.batchDelete( { "ids": [threads[i].getMessages()[j].getId() ]}, "me" );
}
}
}
//一个谷歌应用程序脚本,用于清除我的gmail垃圾。
//
//它确实有效,但有更好的方法吗?
//
函数delete\u my\u gmail\u trash(){
var threads=GmailApp.search(“in:trash”);
对于(var i=0;i