gpt4 book ai didi

google-apps-script - Google App 脚本在没有电子表格权限的情况下无法在文档中显示提示

转载 作者:行者123 更新时间:2023-12-04 15:46:14 29 4
gpt4 key购买 nike

我正在尝试使用 App Script 在 Google 文档中显示消息框。

Browser.msgBox("你好");

当我运行它时,出现以下错误。

You do not have permission to call Browser.msgBox. Required permissions: (https://www.googleapis.com/auth/spreadsheets.currentonly || https://www.googleapis.com/auth/spreadsheets) (line 2, file "restore")

以下是我的文档项目中的 list 条目。

 "oauthScopes" : [
"https://www.googleapis.com/auth/activity",
"https://www.googleapis.com/auth/script.container.ui",
"https://www.googleapis.com/auth/userinfo.email",
"https://www.googleapis.com/auth/documents.currentonly",
"https://www.googleapis.com/auth/drive",
"https://www.googleapis.com/auth/drive.appdata",
"https://www.googleapis.com/auth/gmail.compose",
"https://www.googleapis.com/auth/script.scriptapp"
]

谁能告诉我如何在不在 list 中添加工作表权限的情况下使 Browser.msgBox("Hi There") 工作?

最佳答案

  • 您想在 Google 文档上打开一个对话框。

如果我的理解是正确的,这个解决方法怎么样?不幸的是,类浏览器可用于电子表格。 The official document说如下。

This class provides access to dialog boxes specific to Google Sheets.

The methods in this class are only available for use in the context of a Google Spreadsheet. Please use G Suite dialogs instead.

那么如何使用类 Ui 如下?

DocumentApp.getUi().alert("Hi There");
  • 在这种情况下,没有使用范围。

引用资料:

如果我误解了您的问题,我深表歉意。

关于google-apps-script - Google App 脚本在没有电子表格权限的情况下无法在文档中显示提示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55671928/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com