Slides App: getActivePresentation error after v8 migration

泪湿孤枕 提交于 2020-07-23 06:13:22

问题



Seems to happen when you are logged in with 2 different accounts to Google and test the app - 1 account in Chrome browser and another in Google Slides app or Apps Script panel.

Other than that, all works fine.


I have a function imageToSlide called from html template like this:

google.script.run
  .withSuccessHandler(sidebar.onSuccess)
  .withFailureHandler(sidebar.onAddDocumentError)
  .imageToSlide(url, link, width, height);

Inside it I do var presentation = SlidesApp.getActivePresentation();

After switching to V8 runtime I get an error:

Exception: Action not allowed

It is not a container-bound script. It works without issues in DEPRECATED_ES5 mode.

Google docs say:

If the presentation is already open, the same presentation instance is returned.


I tried using SlidesApp.openById(id) getting presentation id from the event passed to onOpen -> e.source.getId() but still did not work.

来源:https://stackoverflow.com/questions/60453863/slides-app-getactivepresentation-error-after-v8-migration

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!