2

As from GAS References, we take terrific pleasure of the following method: enter image description here

It is - or better it sounds - extremely useful, in case the script exceeds the time limit granted by quotas. But, but, but:

  • "resume" from where? Which in other words means
  • where are tokens, that "are generally valid for one week", stored? Which would lead to the subsequent question
  • how to recall the continuationToken string to use as parameter of DriveApp.continueFolderIterator()?

I am aware of the possibility to use User Properties, as suggested elsewhere, but I would avoid to play such solution since User Properties have a more general purpose.

Gabriele
  • 31
  • 4
  • 2
    related: [1](https://stackoverflow.com/questions/45689629/how-to-use-continuationtoken-with-recursive-folder-iterator), [2](https://stackoverflow.com/questions/22365681/correct-usage-of-driveapp-continuefileiteratorcontinuationtoken), [3](https://stackoverflow.com/questions/49052473/folder-iterator-continuation-token-recursive-loop) – Kos Sep 25 '22 at 16:55
  • I knew (and appreciated) the several solutions proposed with the links submitted by @Kos (Script Properties section is greatly effective for such purpose) but I expect to use the continuationToken in a script different from the one where the continuationToken was got. – Gabriele Sep 25 '22 at 18:24
  • First i would check if it is even possible to run it in another script. Maybe it is bound because of reasons like auth? Simple test would suffice right? – RemcoE33 Sep 25 '22 at 19:33
  • 1
    Hi @RemcoE33, good for you today on bycicle. I found out a solution, and it works: the script calculates elapsed time and on passing the time limit it gets the continuationToken string generated by FolderIterator method. Then the script saves such string in a cell of a specific spreadsheet I created as a sort of "Developer Properties". Then, any different script can recover from the spreadsheet the continuationToken string to be used as argument of the DriveApp methods useful to resume a folder/files iteration. It works, I do not know how and why, but works. – Gabriele Sep 25 '22 at 21:09

0 Answers0