title: Get text from a Google Docs
body: <p>I am quite new the using Google Apps Script, but not to JavaScript. I was wondering if there was a way that I could retrieve some text from a Google Docs, and send it in an email, something like this.
  This is not the correct syntax, but bear with me.</p>
  <pre><code>function createAndSendDocument() {
      var email = &quot;email&quot;;
      var subject = &quot;Subject&quot;;
      var body = 
          GmailApp.sendEmail(email, subject, body);
  }
  </code></pre>
  <p>Is there a way that I could do something like this,</p>
  <pre><code>var randnum = random(1,4)
  getText(documentname, text from document)
  </code></pre>
  <p>Text on the document would look something like this.</p>
  <ol>
  <li><p>Hello</p>
  </li>
  <li><p>Test</p>
  </li>
  <li><p>How are you?</p>
  </li>
  <li><p>Watermelon!
  Where getting the text from the document is based on randnum, example: randnum = 1 so email body would be &quot;Hello&quot;</p>
  </li>
  </ol>
  <p>Sorry for all the jumping around in the question, but hope you can answer this. Comment if you need any clarification.</p>