0

I want to run the script until I finish reading the files, there are 2000 files and it's only doing 100, what do I need to add to finish the script?

enter code here
  var srcfolderId = "XXXXXXX"
  var dstfolderId = srcfolderId;
  var files = DriveApp.getFolderById(srcfolderId).getFilesByType(MimeType.MICROSOFT_WORD);
  while (files.hasNext()) {
  var file = files.next();
  var document = Drive.Files.copy({}, files.next().getId(), {convert: true});; // Modified
  var doc = DocumentApp.openById(document.id);
}
}```
  • This has been answered multiple times already. You will probably use time based trigger to re-run your script where it left off when timed out (You need to save the state) – GoranK Aug 27 '21 at 10:44
  • [batch operations](https://developers.google.com/apps-script/guides/support/best-practices) – Cooper Aug 27 '21 at 15:52

0 Answers0