Multiple onOpen() functions in multiple .gs files
<p>I'm trying to learn Google Apps Script, and I just did a bit of an experiment with creating two <strong>".gs files"</strong> in the same project, each with an onOpen() function.</p>

<p>After saving, closing, and then opening the document, only one of the onOpen() functions ran (the <strong>Sidebar.gs</strong> file).</p>

<p>Do these need to be included in the same file?  Well, I guess I know that it is a work around.  I guess my question is <strong>WHY?</strong></p>

<pre><code>Project:

Code.gs:
    function onOpen() {
    DocumentApp.getUi().createMenu("PACKT").addItem("Greeting","greeting").addToUi();
    }

    function greeting() {
    var ui = DocumentApp.getUi();
    ui.alert("Greeting", "Hello World!", ui.ButtonSet.OK);
    }

Sidebar.js:

    function onOpen() {
    var htmlOutput = HtmlService.createHtmlOutput('&lt;button onclick="alert(\'Hello World!\');"&gt;Click Me&lt;/button&gt;').setTitle("My Sidebar");
    DocumentApp.getUi().showSidebar(htmlOutput);
    }
</code></pre>

<p>Thanks!</p>