问题
Usually addons are the way to distribute a Google Sheets script, but I do not know if that is a fit for my case:
- The user will manually fill out a list of their contacts / friends and answer custom questions about them. So they will, in some sense, definitely need their own copy.
- This should scale reasonably well. i.e. O(users) copies of invisible tabs in a sheet is not going to work.
- The user should be good to go from clicking a link with minimal work. i.e. a dialog saying "Please make your own copy of this sheet!" and forcing them to fork is not ideal (although I guess it could work.)
Idea #1: manual fork
Very much not ideal to make the user go through that workflow and hard to implement. i.e. the dialog to copy-and-fork will of course be present in the copy so additional logic will be needed to (somehow) de-wire that.
Idea #2: bootstrap + copy
The next idea I have is two apps: 1) an installer that needs access to their Google Drive and 2) the sheet it will copy into their Google Drive.
This is... okay. But I don't like that the user has to authorize an unknown script to have arbitrary access to their Google Drive (!!). Even a more specific question like "add a file to your Drive" would get out of this bind.
The other problem is that the user seeing the example sheet makes it clear what the heck is going on. This should feel as safe as copying a sheet (and be that safe), not like the relative hassle of "installing an app," much less one needing sensitive data.
Idea #3: Obscure addon
I'm not sure if an addon that lives inside of a spreadsheet can be self-discoverable.
But, from there, I believe the addon would unpack the entire structure of the sheet from script. This is something I can handle, even though it seems kludgey still. And this may even require the user having a blank sheet ready first?
Initially I asked about tracking forks. Now I am much more ambitious in that I am looking for an actual proper distribution mechanism that is not asking users to just manually fork everything.
来源:https://stackoverflow.com/questions/42322769/publish-and-distribute-a-google-sheets-with-app-scripts-so-user-gets-private-cop