title: Looking a method to access the total unread messages in the primary tab
body: <p>I have used the <code>"in:unread category:primary"</code> query in Gmail and it displays the information i am looking for, along with the total as a number (for example "1-8 of 8"). I have used the following code to produce the same effect.</p>
  
  <pre><code>var monitor = "unread ";
  var primAry = "primary";
  var search = "in:monitor" + "category:" + primAry;
  var threads = GmailApp.search(search, 0, 5); 
  </code></pre>
  
  <p>To read each message I use the following code</p>
  
  <pre><code>for (var i = 0; i &lt; threads.length; i++) {
      msg = threads[i].getMessages()[0];
  }
  </code></pre>
  
  <p>I am aware of <code>getInboxUnreadCount()</code> and <code>getPriorityInboxUnreadCount()</code> methods. </p>
  
  <p>Is there a method to assign to a variable the total number of unread emails 
  in the primary tab, as Gmail does (eg "1-8 of 8")?</p>