title: Alert app script not work after add in google sheet
body: <p>I create code for alert:</p>
  <pre><code>function alert() {
       var sheet = SpreadsheetApp.getActiveSheet();
       var value = sheet.getRange(&quot;F6&quot;).getValue();
       var alter = sheet.getRange(&quot;E6&quot;).getValue();
  
      Logger.log(value)
      if (value == alter)
         Logger.log('yes')
         SpreadsheetApp.getUi().alert(&quot;the pice is avilable&quot;)
      }
  </code></pre>
  <p>it's work fine but after add <code>=alert()</code> in cell not working give me #ERROR <code>Exception: Cannot call SpreadsheetApp.getUi() from this context. (line 9).</code></p>