title: Google Script - Simple function not doing anything
body: <p>I made a function nearly identical to this and it worked great.  This one tells me it is running but nothing actually happens in my inbox.  I get no errors, either.</p>
  
  <p>(This is my first day working with Google scripting so I'm sure it's a rookie mistake.)</p>
  
  <pre><code>function autoArchiveOldInboxItems() {
    var search_term = "label:inbox older_than:30d";
  
    while(GmailApp.search(search_term).length &gt; 0){
      var threads = GmailApp.search(search_term,0,100);
  
      GmailApp.markThreadsRead(threads);
      GmailApp.moveThreadsToArchive(threads);
    }
  
  }
  </code></pre>
  
  <p>I tried searching "in:inbox" as well as "label:inbox".</p>