Audit your Google Drive Privacy!

function driveSearch() {// Log the name of every file in the user's Drive whose visibility is publicvar files = DriveApp.searchFiles('(visibility = "anyoneWithLink" or visibility = "anyoneCanFind" or visibility = "domainCanFind" or visibility = "domainWithLink" or visibility != "limited") and "me" in owners');while (files.hasNext()) {var file = files.next();Logger.log(file.getName());}}
function myfunction() {var files = DriveApp.searchFiles('"me" in owners');var counter = 0;var counterPrivate = 0;while(files.hasNext()) { var file = files.next();var viewers = file.getViewers();var editors = file.getEditors();counter = counter + 1;if (viewers.length > 0 || editors.length > 0) {counterPrivate = counterPrivate + 1;Logger.log('Filename: %s', file.getName());for (var i = 0; i < editors.length; i++) {Logger.log('Editor: %s', editors[i].getEmail());}for (var i = 0; i < viewers.length; i++) {Logger.log('Viewer: %s', viewers[i].getEmail());}}}Logger.log('Total files audited: %s, Total files not private: %s', counter, counterPrivate);}

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store