Monitor Google Drive folders with Google Apps Script

Google Drive comes with beautiful tools to get notified about changes happening to a shared document. Sometimes you need also to be notified when somebody adds a document to a specific folder. This Google Apps Script allows you to specify which folders to monitor and to get notified about folder changes.

A new menu is added by the script as shown here:

Drive Folder Monitor 1

Clicking on menu item “Configuration” the script will load the configuration interface:

Drive folder monitor configuration

You can select one by one the Drive folders you want to monitor and using the “Add ->” button you can add them the to the list of monitored folders. For now it’s only possible to monitor first level folders. The script also doesn’t play well with huge folders due to script operation timeout so use caution when selecting the folders. Using this interface you can also set the monitoring interval using the drop drown menu after “Run drive folder monitor each”.

The script will run at specified triggers interval, if modifications are detected, the script will automatically send the user a notification email message like the following:

Notification email about monitored folders

Using the menu “Run folder monitor” you can run the script manually.

To use this script just make a copy of this spreadsheet file: Google Drive Folder Monitor and proceed to the “Configuration” menu item.

 

 

Consultant, Lean Thinker, Agilist, Technology Lover. Dream: Being worth a TED talk. Project Manager in a wide variety of business applications. Particularly interested in innovation projects, as well as close interaction with costumers.

Taggato con: , ,
Pubblicato in Google Apps Script, Google Drive
12 commenti su “Monitor Google Drive folders with Google Apps Script
  1. David French says:

    Neat and useful example. To get around the large folder (time) issue, did you consider using a DRIVE SDK FILES:List search to get folders and files within parent folders that have been modified since last look? https://developers.google.com/drive/v2/reference/files/list

  2. That’s absolutely a good point. For what I understand the Google Apps Script DocsList service doesn’t provide a direct function to get all children of a specific folder, including sub folders. I don’t think it’s possible to use the Drive SDK inside Google Apps Script but today I’ll check with them during office hours to see a possible solution.

  3. I made some research and yes it’s possible to interact with drive api, it seems not possible to use the javascript client SDK but it can be manually implemented using REST calls and parsing json results. Maybe the Google Apps Script team is already working on that

  4. There is a nice little trick if you want to share a spreadsheet, and people have to make their own copy first: add &newcopy=true

    So the link to this interesting script will become:
    https://docs.google.com/spreadsheet/ccc?key=0AiVfk2mjBcimdC0xX25HZEt3U3VmNFBOLWg2bWRXcWc&newcopy=true

  5. Jeff says:

    I do not see a Drive Folder Monitor tab when I copy and paste this link into chrome: https://docs.google.com/spreadsheet/ccc?key=0AiVfk2mjBcimdC0xX25HZEt3U3VmNFBOLWg2bWRXcWc

    I also put this into chrome and made a copy and still no Drive Folder Monitor tab:
    https://docs.google.com/spreadsheet/ccc?key=0AiVfk2mjBcimdC0xX25HZEt3U3VmNFBOLWg2bWRXcWc&newcopy=true

  6. Riley says:

    Hi there! I stumbled across this site today and wow, I’m so excited! the only bummer is that all of my folders are organized into folders and I need to be able to know what’s changed inside of them, too.

    I beg of you to consider making a version that will check subfolders because no, according to Google, they do not appear interested in developing this feature. Despite this long-running thread here and claiming it’s bee “COMPLETED”:

    https://productforums.google.com/forum/#!msg/drive/fsYwbZ3hpjc/bsEQvwEocokJ

    The sad thing was that the functionality existed when it was just Google Docs, but now that it’s Drive – nope. This feature only exists for spreadsheets. I desperately need this feature… and as you can see in the post, so do many, many others. :/

  7. Tara says:

    Fantastic script but unfortunately we can’t use it as so few people keep lots of files at root level – we need to use subfolders to keep it tidy.

    Please do consider doing a folder monitor for subfolders – it would be something worth paying for.

  8. Aidan says:

    This is a great script, would really need the following functionalities though:

    - Be able to select a sub-folder from the list (the folder I’m interested in isn’t on the 1st level!)
    - Be able to see updates for all changes to a folder & its sub-folders

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>