title: EventGuest getName() method not working
body: <p>I just started coding with Google Apps Script.</p>
  
  <p>I tried to write a simple program to pull in events from my calendar and email all the guests in these events.</p>
  
  <p>I have run into 2 problems: </p>
  
  <ol>
  <li><p>the getName() method returns the guest's email address and not name, even though the name is defined in my Google contacts. (Also, if no name is defined, according to the documentation, it would return null).</p></li>
  <li><p>I can't seem to use the getCalendarsByName method. getCalendarByID is working correctly, but the getCalendarsByName method doesn't return the calendar wanted. I've also tried getOwnedCalendarsByName, but that doesn't work either.</p></li>
  </ol>
  
  <p>Would appreciate any help from anyone.</p>
  
  <p><strong>Update at 7/1 3.30pm</strong>: Thanks to @Serge insas, the second problem has been solved.
  However, the first problem remains. Here's the code:</p>
  
  <pre><code>function myFunction() {
      var calendar = CalendarApp.getCalendarsByName('Test Calendar');
      Logger.log(calendar[0].getName());
  
      var today = new Date(); // get today's date
      Logger.log(today.toLocaleString());
      var endDate = new Date(); 
      endDate.setDate(today.getDate() +7); // set nextWeek's date to 7 days from today
      Logger.log(endDate.toLocaleString());
  
      var testEvents = calendar[0].getEvents(today, endDate);
      Logger.log(testEvents[0].getTitle());
      var guests = testEvents[0].getGuestList();
      Logger.log(guests[0].getName());
  }
  </code></pre>
  
  <p>Here is the Log output: </p>
  
  <pre><code>Test Calendar
  July 1, 2012 3:27:58 PM EDT
  July 8, 2012 3:27:58 PM EDT
  Test Event 1
  duytri.nguyen07@gmail.com
  </code></pre>
  
  <p>The last line is my email other email address, even though it has been named in my contacts.</p>