title: User Installable Every Minute Trigger to Standalone Script via Button
body: <p>I would like a user to be able to tap a button in a sheet to install a trigger for a standalone script that will manage a couple of mail functions. I need this because I have a user that cannot follow instructions, and thus I cannot ensure they will create a trigger manually, properly.</p>
  <p>I would like them to just open a Google Sheet, tap the button, approve what needs approving, then be good to go.</p>
  <p>So, they need</p>
  <ol>
  <li>The '<strong>main</strong>' function of my &quot;<em>amazingLabels</em>&quot; standalone Google Apps Script to trigger every minute.</li>
  <li>That must be installed by the <em>amLabsInstallSheet</em> Google Sheet.
  They have read access to both.</li>
  </ol>
  <p>I have used <a href="https://stackoverflow.com/a/56364403">this answer</a> as the basis for what I'm trying to do, I haven't found anything better, the only thing I've changed is some names.</p>
  <hr />
  <p>So, I have created my own standalone script <em>amazingLabels</em> and inside it is the following:</p>
  <pre><code>function doGet(e) {
    createTrigger();
    return ContentService.createTextOutput('success!');
  }
  
  function createTimeTrigger() {
    UrlFetchApp.fetch('appUrlExec');
  }
  
  function createTrigger() {
    var tr = ScriptApp.newTrigger('main');
        tr.timeBased().everyMinutes(1).create();
  }
  
  function main() {
    mainOne();
    mainTwo();
  };
  </code></pre>
  <p><em>Where <code>appUrlExec</code> is the /exec link for this amazingLabels standalone script.</em></p>
  <p>Now, I should be able to create a spreadsheet, which we'll call <em>amazingLabelsInstaller</em> with amazingLabels as a library, and inside the bound script for the spreadsheet call:</p>
  <pre><code>function testLib() {
    amazingLabels.createTimeTrigger();
  }
  </code></pre>
  <p>However I just cannot get it to install that trigger for the user to run every minute.</p>
  <p>If I focus on <em>any</em> other function, it works. Ie. if I call 'main' directly with amazingLabels.main(); it will run that function.</p>
  <p>What am I doing wrongly here? Is it the new trigger code?</p>
  <p>I've tried every combination of deployment, from a Google Suite deployment, to a private account deployment. From running as myself, to running as the user. I've tried them as editors on both document or none (but it should work as viewers, right?), and with both script and sheet deployed or sheet not-deployed.</p>
  <p>Any help would be appreciated, apologies if anything is unclear, here, happy to work through it in the comments.</p>