Skip to content

AppScript to auto-populate Google Docs with Created and Last Updated dates

License

Notifications You must be signed in to change notification settings

fatoboist/gdoc-fresh

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

gdoc-fresh

AppScript to auto-populate Google Docs with Created and Last Updated dates

How to install:

  1. Open the Google Doc where you want this script to run
  2. Select Tools > Script editor menu
  3. Replace the contents of Code.gs with this code and Save
  4. In the left side menu, open Triggers
  5. Create a new trigger which will call function updateFreshness upon event onOpen

How to use:

  1. In your doc or template, insert {datecreated} and/or {datemodified} placeholders where you want the dates inserted.
  2. Refresh the page to see the dates auto-populated.
  3. On first run, accept permissions to allow the script to run.
  4. Future edits to the page will update the "Last Updated" metadata of the document so that subsequent views of the page will see the revised modified date.
  5. The modified date will be in the format YYYY-MM-DD 📅 and will be highlighted grey to discourage editing. Manually changing the date format or removing the calendar icon will stop automatic updates. The calendar icon links to this repo to provide curious readers with context.

Contributing

Pull requests welcome!

About

AppScript to auto-populate Google Docs with Created and Last Updated dates

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%