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?
You can publish it privately. This way you can publish it instantly (google doesn't need to review it), it's only visible and install-able by you, and you don't have to pay the developer fee.
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