title: Service invoked too many times for one day: gmail
body: <p>I've tried searching over here for this but am not finding my solution.
  I have the following script:</p>
  
  <pre><code>function getMessagesWithLabel() {
   var destArray = new Array();
    var threads = GmailApp.getUserLabelByName('1001').getThreads(0,1);
  
    for(var n in threads){
          var msg = threads[n].getMessages();
          var destArrayRow = new Array();
          destArrayRow.push('Record');
            for(var m in msg){
                       destArrayRow.push(msg[m].getPlainBody());
             }
    destArray.push(destArrayRow);           
          }
  Logger.log(destArray);
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var sh = ss.getActiveSheet();
  if(ss.getLastRow()==0){sh.getRange(1,1).setValue('getMessagesWithLabel() RESULTS')};
  sh.getRange(ss.getLastRow()+1,1,destArray.length,destArray[0].length).setValues(destArray)
  
  var sheet = ss.getSheets()[0];
  // Rows start at "1" - this will delete the first row
  sheet.deleteRow(1);
  } 
  </code></pre>
  
  <p>What this does is this imports the last email with the label "1001"
  I have the same script for about 40 labels.
  I'm trying to trigger each one every minute but i'm getting that error.
  What I want to know is if there's a way to combine all "GmailApp.getUserLabelByName" requests in one request? and each result should be in a different row? 
  What happens now is, it takes the result, put's it in row 2, and deletes row 1, and so on.</p>
  
  <p>I don't mind having all results on one sheet. </p>
  
  <p>Anyone with any idea for me?</p>