How to share a google doc in template mode, and include appscript

88 views Asked by At

What I have: a google doc with some text and custom appscript

What I want to do: I want to provide this document as a template that others in my team can copy for their use, but cant edit the original

What I've tried: I tried using google URL tricks to do mydocURL/template/preview to provie a view showing the template in read only, and a button 'use template'. However when clicking 'use template' it does not copy the companion appscript, only the initial text.

What I'm lookingfor: Some other URL trick, or intermediate appscript I can use to allow a team member to provide their drive share folder, and then it makes a copy to their folder?

1

There are 1 answers

2
Fastnlight On BEST ANSWER

Click the share button in the top right corner, make sure everyone has viewing permissions. I recommend setting it to "anyone with the link" and giving it viewer permissions: enter image description here Click "Copy link". Your URL should look like this:

https://docs.google.com/document/d/<ID>/edit?usp=sharing

If you are using a different service (eg. sheets), the document part of the url may be different, but the same concept applies.

Change the /edit?usp=sharing to /copy.

https://docs.google.com/document/d/<ID>/copy

Send people that link. The result should look like this: enter image description here Any app script on the doc will also be copied and added to the project automatically, but the user will have to manually authenticate/deploy (if needed)