title: Is it possible to add custom menus for several Google Docs at the same time?
body: <p>Suppose we work with 5 different documents in Google Docs.</p>
  <p>I have a master/main document which has a Google Script in it (it is a very simple project - it replaces some text with another). A MWE of the script is taken from <a href="https://stackoverflow.com/a/70738462/11617040">this answer</a>:</p>
  <pre><code>function onOpen() {
    DocumentApp.getUi()
      .createMenu('Custom Menu')
      .addItem('First item', 'mergeGoogleDocs')
      .addToUi();
  }
  
  function mergeGoogleDocs() {
    var docIDs = ['documentID_1', 'documentID_2', 'documentID_3', 'documentID_4', 'documentID_5'];
    for (var id in docIDs) {
      doSomething(docIDs[id]);
    }
  }
  
  function doSomething(id) {
    // Put the code here using 'id' to open the document
  }
  </code></pre>
  <p>However, when I run <code>onOpen</code>, the button only appears on the master/main document (say &quot;Doc 1&quot;). <strong>I would like to have this button on every Document (Doc 1, Doc 2, ... Doc 5). Is it possible?</strong></p>