- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
试图在用户单击菜单项时添加确认对话框,我几乎完全按照这个 Google 页面进行操作:https://developers.google.com/apps-script/guides/dialogs#alert_dialogs
但是,我收到“不支持此操作”的错误消息。在执行记录中,我看到了这个:
[14-02-10 12:21:54:551 EST] Starting execution
[14-02-10 12:21:55:550 EST] Execution failed: This operation is not supported (line 28, file "Code") [0.226 seconds total runtime]
“代码”中的第28行是下面函数的第二行:
function sendMergedMail() {
var ui = SpreadsheetApp.getUi();
var result = ui.alert(
'Please confirm',
'Are you sure you want to continue?',
ui.ButtonSet.YES_NO);
if (result != ui.Button.YES) {
return
}
var doc = SpreadsheetApp.getActiveSpreadsheet();
doc.toast("Current sheet: "+doc.getName());
};
谢谢!
最佳答案
此代码适用于 new version of spreadsheets ,你升级到新版本了吗?
(刚刚测试,没有问题)
关于google-apps-script - 不支持 SpreadsheetApp.getUi() 操作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21684229/
假设我有一个脚本,它遍历 400 个对象的列表。 每个对象都有 1 到 10 个属性。 每个属性都是一个合理大小的字符串或一个有点大的整数。 将这些对象保存到 ScriptDB 与将它们保存到电子表格
我有一个脚本可以记录电子表格中所有更改的日志: function onEdit() { var timestamp = new Date(); var ss = SpreadsheetApp.
当我运行上面的代码时,我收到“ReferenceError:SpreadsheetApp 未定义”。有没有错误?这在脚本编辑器中有效,但在单独的文件中无效 Site var ss
我是一个完全的初学者。 我阅读了 Google 文档以了解解决方案。我在网上搜索了同样的内容。我也在 StackOverflow 上搜索了同样的内容。 但是。一切似乎都是技术性的。 What I un
这个问题在这里已经有了答案: "SpreadsheetApp.getUi() cannot be called from this context" (4 个答案) Getting user inp
我想创建一个函数来在电子表格的特定单元格中附加(或编辑)值;例如,如果名称为“Amirhossein”且月份为“Jan”,请将值 x 附加到项目列的现有单元格中。 第一个状态: 调用 f("Amirh
我制作了这张公开表来解释我的交替行问题 https://docs.google.com/spreadsheets/d/18PoyJLOgyPaQXl2PGtAzlTcY3c53UDzzGLFjWYQf
当我点击打开我的谷歌电子表格时弹出的消息框时,我正在尝试运行函数 "onReportOrApprovalSubmit()"。当我在脚本编辑器中运行该函数时,它运行得非常好。但是,当我尝试使用首次打开电
我在尝试从 JavaScript 访问 Google 电子表格时收到此错误。 Uncaught ReferenceError: SpreadsheetApp is not defined 为什么会发生
试图在用户单击菜单项时添加确认对话框,我几乎完全按照这个 Google 页面进行操作:https://developers.google.com/apps-script/guides/dialogs#
SpreadsheetApp.AddMenu(name, array of entries)在电子表格的顶部栏中生成一个新菜单。或者,还有 getUI.createMenu这导致了一系列项目。两者都工
我正在尝试使用下面的简单 sendemail 脚本: function sendEmails() { var sheet = SpreadsheetApp.getActiveSheet() v
我正在尝试使用下面的简单 sendemail 脚本: function sendEmails() { var sheet = SpreadsheetApp.getActiveSheet() v
我正在使用 Google Appscript 将数据从一个工作表导入到另一个工作表。但是,当我运行代码时出现错误。 function importdata() { var mainfile =
我有一个 onOpen 函数,可以在电子表格中创建一个自定义菜单。它已经运行了一年多,但几天前它停止工作。 当我查看执行记录时,我得到: “执行失败:您无权调用 SpreadsheetApp.open
所以我在使用谷歌电子表格和应用程序脚本编写的应用程序中遇到了问题。我已经整理了一个分步指南来重现它。 摘要:任何使用 SpreadsheetApp.openByUrl() 和 SpreadsheetA
我被这个脚本卡住了,它不断给出标题中提到的错误。 标题:cell.setHorizontalAlignment(SpreadsheetApp.HorizontalAlignment.CENTE
var MasterSheet = SpreadsheetApp.openById("----------------"); var count = SpreadsheetApp.getActiveS
我的 google 表格应用程序脚本有一个 doGet() 函数,它接受 HTTP get 请求并解析查询参数并将它们放入电子表格中。 当我使用获取请求测试应用程序时,收到“500 内部错误消息”,然
我收到此错误: "The parameters (number[]) don't match the method signature for SpreadsheetApp.Range.setValu
我是一名优秀的程序员,十分优秀!