title: Google Script Cannot call FormApp.getUi() from this context
body: <p>I can't get the simple example copied from the google dev site to work.</p>
  
  <p>The error is: Cannot call FormApp.getUi() from this context</p>
  
  <p>I am NOT attempting to deploy this a web form/app but I am simple trying to run this via the editor!!!</p>
  
  <p>Not sure what I'm doing wrong?!?!?!</p>
  
  <p>The following has been pasted into index.html:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;base target="_top"&gt;
    &lt;/head&gt;
    &lt;body&gt;
      Hello, World!
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>The following is pasted into Code.gs:</p>
  
  <pre><code>// Use this code for Google Docs, Forms, or new Sheets.
  function onOpen() {
    FormApp.getUi() 
        .createMenu('Dialog')
        .addItem('Open', 'openDialog')
        .addToUi();
  }
  
  function openDialog() {
    var html = HtmlService.createHtmlOutputFromFile('Index');
    FormApp.getUi() 
        .showModalDialog(html, 'Dialog title');
  }
  </code></pre>