json - Google Scripts JSON 问题 - 总新手老师试图帮助学生
问题描述
抱歉 - 我不知道 JSON 是如何工作的。我是一名教师,正在尝试在我的 Google 幻灯片中添加翻译工具,以帮助母语不是英语的学生。
我使用了这个:https ://developers.google.com/gsuite/add-ons/editors/slides/quickstart/translate - 我认为没关系,因为它来自 G Suite 开发者插件作为示例编辑器插件之一.
然后我在保存脚本时遇到了一个问题,并试图从这里解决它:https ://developers.google.com/apps-script/concepts/scopes 。
当我进入属性下的范围时,它给了我这些:
脚本所需的 2 个 OAuth 范围:
https://www.googleapis.com/auth/presentations.currentonly https://www.googleapis.com/auth/script.container.ui
所以我进入了appsscript.json,它已经在那里了:
{
"timeZone": "Australia/Sydney",
"dependencies": {
},
"exceptionLogging": "STACKDRIVER",
"runtimeVersion": "V8"
}
然后我将其添加到底部:
{
...
"oauthScopes": [
"https://www.googleapis.com/auth/presentations.currentonly",
"https://www.googleapis.com/auth/script.container.ui"
],
...
}
但是当我保存它时,我得到了这个:
Unexpected character ('.' (code 46)): was expecting double-quote to start field name at [Source: (String)"{ "timeZone": "Australia/Sydney", "dependencies": { }, "exceptionLogging": "STACKDRIVER", "runtimeVersion": "V8" } { ... "oauthScopes": [ "https://www.googleapis.com/auth/presentations.currentonly", "https://www.googleapis.com/auth/script.container.ui" ], ... } "; line: 10, column: 4]
我试过谷歌搜索并使用 JSON Validator,但除了代码明显存在问题之外,我没有任何线索。
如果您能提供帮助,我将非常感谢您帮助我的学生。
干杯
乔恩
解决方案
我认为您的问题是由于您在 JSON 对象中拥有嵌套数组的方式。
查看有关 JSON 的此链接,您还将看到有关数组的部分。
推荐阅读
- android-studio - 访问被拒绝查找属性“persist.vendor.log.tel_dbg”
- python - Python SMTPException,使用瓶子软木瓶插件
- pandas - 大熊猫中的分组求和和除法
- php - symfony 路由器在所有语言环境中匹配 url
- c++ - C++ Socket编程:网络低速分析
- firebase - 任务“:cloud_firestore:extractDebugAnnotations”执行失败
- python - 使用学生数据集进行关联规则挖掘
- python - Flask Post 没有进入同一页面
- java - 增加胎面数量会导致更长的循环持续时间
- ios - 如何在选择时更改自定义表格视图中单元格的 UI 元素的状态?