title: Trouble programmatically deleting timed trigger
body: <p>I have a test script where I'm trying to test out timed triggers. I need to be able to create and delete triggers programmatically - which is possible according to the documentation. However, my trigger will not delete when I need it to:</p>
  
  <pre class="lang-js prettyprint-override"><code>function myFunction() {
    var db = ScriptDb.getMyDb();
    var user = Session.getActiveUser().getEmail();
    var triggerID = ScriptApp.newTrigger("timed").timeBased().everyMinutes(1).create().getUniqueId();
  
    var ob = {
      id: user,
      count: 1,
      trigger: triggerID
    }
  
    db.save(ob);
  }
  
  function timed(){
    var db = ScriptDb.getMyDb();
    var user = Session.getActiveUser().getEmail();
    var ob = db.query({id: user}).next();
    var count = ob.count;
    var triggerID = ob.trigger;
  
    if (count &gt; 4){
      deleteTrigger(triggerID);
      db.remove(ob);
  
    } else {
      Logger.log(count + " " + Utilities.formatDate(new Date(), "GMT", "HH:mm:ss") + " TriggerID=" + triggerID);
      ob.count = count+1;
      db.save(ob);
    }
  }
  
  function deleteTrigger(triggerID){
    var allTriggers = ScriptApp.getProjectTriggers();
  
    for(var i=0; i &lt; allTriggers.length; i++){
      if(allTriggers[i].getUniqueId() = triggerID){
        ScriptApp.deleteTrigger(allTriggers[i]);
        break;
      }
    }
  }
  </code></pre>