title: Time-driven trigger not executing any SpreadsheetApp.getUi functions
body: <p>Why would Time-Driven triggers not call any ‍‍‍‍<code>SpreadsheetApp.getUi</code> or <code>Browser.xxx()</code>, functions?</p>
  <p>If I manually play the function, the lines are executed, but with a time based trigger, the function is called, all other lines are executed, except any calls to the above.</p>
  <p>I wanted a time-driven trigger to display an alert on a spreadsheet based on the time freq set.</p>
  <p>Here is a simple code,
  Time-driven trigger set to run every minute as an example. Tried it with various other time settings.</p>
  <pre><code>function InputTime()
  {
  
  Logger.log(&quot;This code ran&quot;);     // This works fine.
  
  SpreadsheetApp.getUi().alert(&quot;Warning 1&quot;);        // Does not work
  
  this.SpreadsheetApp.getUi().alert(&quot;warning 2&quot;);   // Does not work
  
  Browser.msgBox(&quot;warning 3&quot;);                     // Does not work
  }
  </code></pre>
  <p>Any idea? Also, modifying the values in the sheet by first getting the Id of the sheet and the sheet name ( as suggested by Sergi here), allows the sheet to be edited fine. Similarly is there any way to tie Alert notifications to the particular spreadsheet?</p>