Skip to content

Google Drive Folder Watcher Google Apps Script to get notifications by Slack Webhook

License

Notifications You must be signed in to change notification settings

kenmd/gdrive-folder-watcher-gas

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Google Drive Folder Watcher Add-On

Google Drive Add-On Folder Watcher Google Apps Script to get notifications by Slack Webhook

screenshot

Setup Add-On Manually

Setup Folder Watcher Timer Trigger

  • fill in the Folder ID and Slack Webhook URL and save the config
    • note Slack Webhook URL here is the traditional one without token
  • push "TRY NOW" to test and see if it works fine
  • turn on the trigger if all looks good
  • you can update the timer to less than 1 hour

Setup Google Apps Script Dev Tools

node --version
v14.15.5

npm --version
7.9.0

# https://github.com/google/clasp
npm init -y
npm install --save-dev @google/clasp

npx clasp --version
2.3.0

clasp login
clasp login --status

Setup Add-On by using CLI

  • Now using Apps Script editor in JavaScript is recommended
    • Apps Script editor is significantly improved recently
    • and when you use TypeScript, you cannot use Apps Script editor
    • So now you don't need local development in TypeScript
  • CLI clasp is useful to pull the code and push to GitHub for version control
  • You should be able to use the following commands.
# when you want to start new project from CLI
clasp create --type standalone --title "Title" --rootDir ./src
# when you start new project from https://script.google.com/
# https://developers.google.com/apps-script/guides/standalone
clasp clone --rootDir /src

# you should have proper .clasp.json by create or clone

clasp open

# update local files from remote
clasp pull
# update remote if you changed the code locally
clasp push