Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9633

Google DOCS Footer Error

$
0
0

I got the below script for automatic "last edited" timestamp in thefooter of a Google Document.

function lastEdited() {  var doc = DocumentApp.getActiveDocument();  var id = doc.getId();  var file = Drive.Files.get(id);  var footerSection = (doc.getFooter())?doc.getFooter():doc.addFooter();  footerSection.clear();  var userName = file.lastModifyingUserName;  var date = file.modifiedDate;  var text = '[Last edited by '+ userName +' on '+ Utilities.formatDate(new Date(date), 'GMT+5', 'YYYY/MM/dd hh:mm') +']';  var p = footerSection.insertParagraph(0,text);  p.setAlignment(DocumentApp.HorizontalAlignment.RIGHT);}

But there is below mentioned error in this

SyntaxError: Unexpected token ':' (line 4, file "Code.gs")

Can anyone help me in this?


Viewing all articles
Browse latest Browse all 9633

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>