使用我自己的谷歌驱动器插件,而不发布它 [英] Using my own google drive addon without publishing it

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

问题描述

我刚刚为Google文档创建了插件,已成功通过测试,现在我想使用它。这是非常简单的,它只显示当前文档的id。

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

/ p>

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

当我通过Publish / Test测试它作为插件时(我不确定是否有英文标题,我翻译了捷克语中的按钮名称),它的工作原理与我想要的完全一样。



我如何使用它,就像我从网上商店下载它一样?我不想发布它,因为它对其他人没有多大用处,我必须遵守Google的规定。在Chrome网上应用店开发人员仪表板中:


解决方案

p>



一个Apps脚本绑定到Doc运行onOpen()函数而不将脚本作为附加组件发布,或将绑定脚本作为Web应用程序部署。发布附加组件和部署Web应用程序是完全不同的两件事情。但是,你甚至不需要做那些。您只需打开应用程序脚本绑定的文档,并运行onOpen()函数。另外,onOpen(e)中不需要e参数。这是一个事件参数。



其他有趣的是基于组的出版:

在Chrome网上应用店中进行基于组的发布 p>

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.

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

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

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.

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?

解决方案

In the Chrome Web Store developer Dashboard:

Developer Dashboard

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"

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:

Group-Based Publishing in the Chrome Web Store

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

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