So, I have a bunch of Google Apps Scripts that use the onOpen/onInstall functions to load a menu or do some minor startup stuff. All of them have been working in the gallery for quite some time.
Recently, and I'm not exactly sure of the time on this, something Google has updated has caused a problem where:
- OnOpen doesn't seem to always execute on open
- OnInstall fires but doesn't have access to functions in the script. Specifically, if you try to select a menu item, Apps Scripts brings up an error saying the function does not exists (but it does)
There is an incredibly crappy workaround for the user: install the script twice. Somehow this gets the functions registered and the onInstall gets the menu loaded. But this only works until the sheet is closed; then they have to install again.
So here is my questions:
- Are other people having this problem, have they figured out a workaround?
- Is this something Google has acknowledged and is getting fixed?
- Does anyone know when this happened?
Finally, I'd like to suggest the idea of "freezing" the api for a script in production. IE. we place a variable at the top saying we are using API version XXX and that is the API that fires out Apps Script. This is the third time I've had scripts in production that were then broken by a Google update. At some point we need to be able to know that when we put something out to the world that it will continue to work. Users don't make the distinction between our mistake and a bug in the API, which means that we take the heat from these sorts of problems.