使用我自己的Google文档插件而不发布它 [英] Using my own Google Docs addon without publishing it

查看:129
本文介绍了使用我自己的Google文档插件而不发布它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚为Google文档制作了一个插件,已经成功对其进行了测试,现在我想使用它.非常简单,只显示当前文档的ID.

I have just made an addon for Google docs, successfully tested it and now I would like to use it. It's very simple, it just shows the id of the current document.

这是脚本中最重要的部分,仅由onOpen(e)函数调用:

This is the most important part of the script, just called by the onOpen(e) function:

DocumentApp.getUi().alert(DocumentApp.getActiveDocument().getId())

当我通过Publish/Test as addon测试它时(我不确定使用英文标题,我翻译了捷克语中的按钮名称).

When I tested it by the Publish/Test as addon (I am not sure with English titles, I translated the button names from Czech) it works exactly as I want.

我如何使用它,就像从网上商店下载它一样?我不想发布它,因为它对其他人没有太大用处,并且我必须遵守Google想要的规则.有可能吗?

How can I use it the same was as I would download it from the webstore? I don't want to publish it, because it isn't much useful for others and I would have to follow the rules, wich Google wants. Is it possible?

推荐答案

在Chrome Web Store开发人员仪表板中:

In the Chrome Web Store developer Dashboard:

开发人员仪表板

您可以添加要作为草稿发布的项目".然后,您可以在发布项目之前对其进行编辑.在编辑项目"页面的最底部,有3个可见性选项设置.最后一个是私人"

You can add an "Item" to be published as a draft. Then, you can edit the item before publishing it. At the very bottom of the "Edit Item" page, there are 3 settings for visibility options. The last one is "Private"

绑定到文档的Apps脚本运行onOpen()函数,而不会将该脚本发布为附加组件,也不会将绑定的脚本部署为Web应用程序.发布加载项和部署Web应用程序是完全不同的两件事.但是,您甚至都不需要这样做.您需要做的就是打开与应用脚本绑定的文档,然后onOpen()函数将运行.另外,您在onOpen(e)中不需要e参数.那是一个事件参数.

An Apps Script bound to a Doc runs the onOpen() function without publishing the script as an Add-on, or Deploying the bound script as a web app. Publishing an Add-on, and deploying a web app are two totally different things. But, you don't even need to do either of those. All you need to do, is open the Doc that the Apps Script is bound to, and the onOpen() function will run. Also, you don't need the e argument in onOpen(e). That's for an event parameter.

有趣的是基于组的发布:

Something else that's interesting is group based publishing:

Chrome中基于组的发布网上商店

这篇关于使用我自己的Google文档插件而不发布它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆