简体   繁体   English

警报不适用于Google Apps脚本

[英]Alert isn't working in Google Apps Script

I am trying to use an alert in my scripts but nothing is happening and I'm not sure why. 我正在尝试在脚本中使用警报,但是没有任何反应,我不确定为什么。 I've using the exact code found in the Google Documentation but must be missing something. 我使用的是Google文档中的确切代码,但一定缺少某些内容。 Any idea why I don't see the alert with the code below? 知道为什么我看不到以下代码的警报吗?

 function alertTest() { SpreadsheetApp.getUi().alert('Working?'); } 

The code is correct, so the function may not be getting triggered. 代码正确,因此可能不会触发该功能。 Add a Logger.log('test ran!'); 添加一个Logger.log('test ran!'); statement, and VIEW the LOG to see if anything printed to the LOG. 语句,然后查看日志以查看是否有任何内容打印到日志中。 If nothing printed to the LOG, then the function never got triggered. 如果没有任何内容打印到LOG,则该函数永远不会触发。 If there is an error that is killing your code, it should show up in the VIEW, EXECUTION TRANSCRIPT log. 如果存在导致您的代码被杀死的错误,则该错误应显示在VIEW,EXECUTION TRANSCRIPT日志中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM