Google Apps Script – Using Google Apps Script Add-On Without Publishing

google docsgoogle-appsgoogle-apps-scriptgoogle-apps-script-add-on

I've just written my first Apps Script add-on for showing some links in a sidebar of a Docs document.

It looks like the way I created it made it bound to a specific document (the one from which I clicked Tools > Script Editor). When I open this document, the script shows up under the Add-ons menu item.

I would like the add-on to be available in my other documents as well, but I don't feel like publishing it: It requires me to add screenshots, icons, and other stuff that prevents me from being able to flesh out a script without too much fuzz.

I tried to publish it with "Private visibility" but that didn't make it available to my other documents (tried searching in Add-ons > Get add-ons).

So how do I make the script available to use in all my documents? Can I detach the script from the original document and would that help?

Best Answer

I tried to publish it with "Private visibility" but that didn't make it available to my other documents (tried searching in Add-ons > Get add-ons).

...

So how do I make the script available to use in all my documents?

Publishing and add-on as privately (unlisted or limited to a group of users) will not display the add-on on the add-ons store, except for those that use Google Apps / G Suite account.

To install the add-on, the publisher should grab the add-on listing URL and share it with the users in order to make them be able to install it.

To grab the add-on listing URL, on the Chrome Web Store dashboard, click on the name of the published add-on.

That will open the add-on listing.

Grab the URL shown on the web browser address bar (Chrome call it omnibox). If it contains ?authuser=n or &authuser=n, where n will be an integer, remove that part and share the URL with the add-on users.

To install the add-on for yourself, click the Free button.


Can I detach the script from the original document and would that help?

The way to "detach" a script from a document, is to create an standalone Apps Script project but it could involve to make changes to the code as there some features that can't be tested directly like methods that get the active document and that are blocked when the script is run from Run > Test as add-on.... This rather than making the things easier could be a bit harder and if the add-on is intended your use only, there is not an important gain unless you will use a development process that requires a stand-alone Apps Script project.