Google apps script refreshSlides异常:不允许执行操作

Google apps script refreshSlides异常:不允许执行操作,google-apps-script,google-slides-api,Google Apps Script,Google Slides Api,我有一个谷歌幻灯片2020版,我把它复制到2021版。 但现在我得到了错误 Exception: Action not allowed refreshSlides @ Code.gs:9 剧本是: function refreshSlides(){ var currentPresentation, i, linkedSlide, numSlides // loop through all slides and refresh them currentPresentat

我有一个谷歌幻灯片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);

    }
}
但那没用。 我在这里遗漏了什么?

正如在刷新幻灯片()中所述,会删除一个错误:

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


确保您已阅读活动演示文稿和每张幻灯片。

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

我在本演示文稿的脚本编辑器中工作,因此我假设我有阅读权限……您对每张幻灯片都有阅读权限吗@雅各布斯有没有一个简单的方法来检查?我是杂志的编辑presentation@Jacobs你能看完所有的幻灯片吗?我能看完。
  "oauthScopes": [
    "https://www.googleapis.com/auth/presentations.currentonly",
    "https://www.googleapis.com/auth/presentations"
  ],