title: When Google document is copied with container-bound script, how to get its installable triggers?
body: <h2>Issue</h2>
  
  <p>I have a container-bound script attached to my document.
  It has <code>onOpen</code> installable trigger and I need to get the script in newly created documents. 
  The most effective way I found is to create the new documents by copying from the original document.</p>
  
  <p><strong><code>The problem is, that the triggers are not copied with it.</code></strong></p>
  
  <h2>Conditions:</h2>
  
  <ol>
  <li>Simple triggers are not enough, I need to use action requiring authorization</li>
  <li>I don't want to force my users to create manually trigger for each document</li>
  <li>I don't mind if the installable trigger is created after clicking button from the programmatically created menu</li>
  </ol>
  
  <h2>My thoughts:</h2>
  
  <p>I wanted to create it programmatically – there is a problem with the testing environment. I am getting an error: </p>
  
  <blockquote>
    <p>The add-on attempted an action that is not permitted in Test as add-on
    mode. To use this action, you must deploy the add-on.</p>
  </blockquote>
  
  <p>as I understood, I need to release the project to the store to use this, which I don't want to do.</p>
  
  <p>I don't mind release as an add-on, but the google script IDE only offers to release as web Docs web add-on.</p>
  
  <p>Code:</p>
  
  <pre><code>function onOpen(e){
      DocumentApp.getUi() // Or DocumentApp, SlidesApp, or FormApp.
          .createMenu('Custom menu')
          .addItem('Open sidebar automatically', 'createTrigger')
          .addToUi();
  }
  
  
  function createTrigger() {
      var doc = DocumentApp.getActiveDocument();
      ScriptApp.newTrigger('onOpenReal')
          .forDocument(doc)
          .onOpen()
          .create();
  }
  
  function onOpenReal(e){
      ...something requiring authorization...
  }
  </code></pre>