更新时间:2023-02-05 12:22:47
第一个选项
First Option
使用服务帐户. //developers.google.com/identity/protocols/OAuth2ServiceAccount"rel =" nofollow noreferrer>假冒文件所有者.
Use the service account which would impersonate the owner of the document.
此处是如何合并服务的示例Apps脚本中的帐户.
Here is an example how to incorporate a service account in Apps Script.
确保您将必要的范围赋予服务帐户 并启用全域委派.
Make sure that you give to the service account the necessary scopes and enable domain-wide delegation.
第二个选项
Second option
第三种选择
Third Option
使用可安装触发器-这将代表您运行授权后.您可以例如设置一个可安装的onEdit触发器,如果用户编辑了某个单元格(例如"A20"),它将触发脚本功能.
Use an installable trigger - this will run on your behalf after you authorize it. You can e.g. set-up an installable onEdit trigger that will fire the script function if a certain cell (e.g. "A20") is edited by the user.