Skip to content

Instantly share code, notes, and snippets.

@nico-abram
Created September 20, 2018 07:42
Show Gist options
  • Save nico-abram/ec510fac76109820ee24ae3a93686a22 to your computer and use it in GitHub Desktop.
Save nico-abram/ec510fac76109820ee24ae3a93686a22 to your computer and use it in GitHub Desktop.
function countFilesInFolder() {
var c=1;
var size = 0;
var folderName = "Packs3";
var folders = DriveApp.searchFolders('sharedWithMe and title contains "'+folderName+'"');
var folder = folders.next().getFiles();
while (folder.hasNext()){
var file = folder.next();
c+=1;
size +=file.getSize();
}
Logger.log(c);
Logger.log(size);
return;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment