且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

共享工作表的其他人如何运行我的Google Apps脚本?

更新时间:2023-12-01 10:27:34

要解决此问题,您需要将脚本部署为Web应用程序(此想法来自@MarioR答案,但设置不同):

To fix this, you need to deploy the script as a web app (the idea comes from @MarioR answer, but the settings are different):

  • 使用所有者帐户,打开工作表,然后打开脚本编辑器
  • 点击Publish,然后点击Deploy as web app
  • 对于Execute the app as,选择User accessing the web app,对于Who has access to the app,选择Anyone
  • With the owner account, open the sheet, then script editor
  • Click on Publish and then Deploy as web app
  • For Execute the app as, choose User accessing the web app and for Who has access to the app, choose Anyone

用户第一次尝试使用该脚本时,将不得不允许该脚本(如果获得This app isn't verified,则应单击底部的Advanced,然后单击Go to <script name> (unsafe)).之后,他们可能需要刷新工作表才能运行脚本.

The first time the users try to use the script, they will have to allow the script (if they get a This app isn't verified, they should click on Advanced at the bottom and then Go to <script name> (unsafe)). After this, they may need to refresh the sheet to be able to run the script.

如果所有者将表单共享给新用户,则在脚本作为Web应用程序部署后,新用户可能需要等待15分钟(或大约15分钟),然后才能被授权对脚本进行授权(同时该用户将继续获得红色警告).

If the owner shares the sheet to a new user, after the script has been deploy as a web app, the new user may need to wait 15 minutes (or so) before being allowed to authorize the script (meanwhile this user will continue to get the red warning).

只有所有者可以将其部署为Web应用程序,其他尝试执行此操作的用户将不会收到消息错误,只是弹出窗口Fetching Data会永远卡住!) 要更改所有者,请执行以下操作:用所有者帐户打开工作表,单击Share> Advanced>单击触发将来成为所有者"旁边的下拉菜单的箭头> Set as owner

Only the owner can deploy as a web app, the other users who try do to it won't get a message error, just a popup Fetching Data that remains stuck forever!) To change the owner: open the sheet with the owner account, click on Share > Advanced > Click on the arrow that triggers the dropdown next to the "owner-to-be" > Set as owner