0

I'm looking to retrieve the entire folder/subfolder directory from MyDrive and print out to a file type (not sure what' possible). I ran the following code and received a "max execution timeout" error.

// Log the name of every folder in the user's Drive.
var folders = DriveApp.getFolders();
while (folders.hasNext()) {
var folder = folders.next();
Logger.log(folder.getName());
}

MyDrive contains over 20,000 files, not sure on the folder/sub-folder count. I'm assuming the above code is meant as a starting point and not the actual full script.

Any help would be appreciated to help me get around this issue. I only need to run the script once.

Thanks, Ryan.

Dmytro Sadovnychyi
  • 6,171
  • 5
  • 33
  • 60
gr8
  • 1
  • possible duplicate of [Correct usage of DriveApp.continueFileIterator(continuationToken)](http://stackoverflow.com/questions/22365681/correct-usage-of-driveapp-continuefileiteratorcontinuationtoken) – Zig Mandel Apr 17 '15 at 12:12
  • I remember seeing one that also dealt with folders but the other one i just linked also covers it. Google it as its a common question answered more than once on s.o. – Zig Mandel Apr 17 '15 at 12:33

0 Answers0