refreshSlides 异常:不允许操作

问题描述

我有一个可用的 Google 幻灯片 2020 版,我将其复制到了 2021 版。 但现在我得到了错误

Exception: Action not allowed
refreshSlides   @ Code.gs:9

脚本是:

function refreshSlides(){
  var currentPresentation,i,linkedSlide,numSlides
  
  // loop through all slides and refresh them
    currentPresentation = SlidesApp.getActivePresentation();
    numSlides = currentPresentation.getSlides().length;
    for (i = 0; i < numSlides; i++) {
      linkedSlide = currentPresentation.getSlides()[i]
      linkedSlide.refreshSlide();
    Utilities.sleep(5000);

    }
}

我尝试通过向 appsscript.json 添加(见下文)来添加授权

  "oauthScopes": [
    "https://www.googleapis.com/auth/presentations.currentonly","https://www.googleapis.com/auth/presentations"
  ],

但这并没有帮助。 我在这里错过了什么??

解决方法

正如 official documentation 中所述,for(var i in users){ String name = i['first_name'] + " "+ i['last_name']; print(name);} ListView.separated( itemCount: users.length,separatorBuilder: (context,index) => Divider(),itemBuilder: (BuildContext context,int index) { var user = users[index]; return ListTile( title: Text(name),isThreeLine: true,); },), 会抛出错误:

如果对源演示文稿的读取权限不再可用。

确保您拥有当前演示文稿和每张幻灯片的读取权限。

,

已解决,有一张幻灯片是“链接幻灯片” 链接幻灯片未经授权。

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...