gmail - Google Script - Simple function not doing anything -


i made function identical , worked great. 1 tells me running nothing happens in inbox. no errors, either.

(this first day working google scripting i'm sure it's rookie mistake.)

function autoarchiveoldinboxitems() {   var search_term = "label:inbox older_than:30d";    while(gmailapp.search(search_term).length > 0){     var threads = gmailapp.search(search_term,0,100);      gmailapp.markthreadsread(threads);     gmailapp.movethreadstoarchive(threads);   }  } 

i tried searching "in:inbox" "label:inbox".

for reason, made happy:

function kickoff(){   autoarchiveoldinboxitems(); } function autoarchiveoldinboxitems() {   var search_term = "label:inbox older_than:30d";    while(gmailapp.search(search_term).length > 0){     var threads = gmailapp.search(search_term,0,100);      gmailapp.markthreadsread(threads);     gmailapp.movethreadstoarchive(threads);   }  } 

then, call kickoff function , runs. strangely, when did before, in editor , chose run function , kept doing nothing. possible bug? or maybe it's me.

you should see inbox now. :)


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -