I'm fairly new at writing JS code and using Apps Scripts. Here's what I'm trying to accomplish : I am sending a link to a google document (created using Autocrat) to the user. The document is a work ticket. I want them to open it, and have a button on the doc they can click that says "Done". When they click the button, the script will grab the name of the active doc and append "Done" to the name. So, for example, the work ticket doc name is "Fix broken keyboard" and after clicking button, it will show "Done - Fix broken keyboard". At this point, I'm stuck on the name change part....haven't attempted the clickable button part but I think I saw an example script for that....
Here is what I have in the script for the doc :
function renameDoc() {
var doc = DocumentApp.getActiveDocument().getName();
doc.setName = ('Done' + Name);
}
I know this is wrong, I have tried a bunch of other things....apparently there used to be a Rename(name) that is now void. I can write a script that creates a NEW doc and appends the name of the active doc, but not rename/append the ACTIVE doc. Any help is appreciated.