从 google 个文档中自动获取 google 个工作表中的字数

Get wordcount automatically in google sheets from google docs

我使用了之前 post 中的代码,请参阅下面的 link:

据我所知,我正在做与上面 link 中的 post 中描述的相同的事情,但我无法使脚本工作。它仍然显示相同的错误消息:

Exception: You do not have permission to call DocumentApp.openByUrl. Required permissions: https://www.googleapis.com/auth/documents (rad 82).

我错过了什么?根据前面的 post,如果您使用自定义菜单调用而不是自定义函数,它应该可以工作。 提前致谢! /K

您需要以大写形式键入函数名称。就像他们在脚本中一样:

function GETDOCWORDCOUNT(url)
function GETDOCTITLE(url)

这是 GETDOCTITLE() 的工作流程

它会再次显示错误。

保持冷静,点击Custom script > Run GETDOCTITLE

我们开始吧: