Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-apps-script/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Loops continuationToken与上一个相同_Loops_Google Apps Script_Iterator_Google Drive Api_Google Docs - Fatal编程技术网

Loops continuationToken与上一个相同

Loops continuationToken与上一个相同,loops,google-apps-script,iterator,google-drive-api,google-docs,Loops,Google Apps Script,Iterator,Google Drive Api,Google Docs,我使用googleapps脚本函数DriveApp迭代425个文件夹。 该函数在每次运行时处理一个文件夹,并将continuationToken保存为UserProperty。它每分钟都在运行 我的问题是,在多次运行~300次后,continuationToken与上一次相同,我无法通过循环 我用许多不同的方法编写了这个脚本,但是令牌问题总是发生在不同的文件夹中。即使每次运行时我处理多个文件夹 我基本上就是这样做的: function name(){ var proper = Propert

我使用googleapps脚本函数DriveApp迭代425个文件夹。 该函数在每次运行时处理一个文件夹,并将continuationToken保存为UserProperty。它每分钟都在运行

我的问题是,在多次运行~300次后,continuationToken与上一次相同,我无法通过循环

我用许多不同的方法编写了这个脚本,但是令牌问题总是发生在不同的文件夹中。即使每次运行时我处理多个文件夹

我基本上就是这样做的:

function name(){
  var proper = PropertiesService.getUserProperties();
  var alla = proper.getProperty('addLoop');
  if(alla == "")
    alla = DriveApp.getFolderById("ID").getFolders();
  else
    alla = DriveApp.continueFolderIterator(alla);

  if(alla.hasNext()){
    var next = alla.next();
    proper.setProperty('addLoop', alla.getContinuationToken());
    functionName(next);
  }
  else
    proper.setProperty('addLoop', "");
}

我不敢相信这是一个脚本错误,但我也没有读到应用程序脚本使用的任何限制。。。我对任何输入都感到无知和高兴。

可能的重复项在循环之前您无法获得令牌。这是右边的。我复制了一份,这个问题也没有得到回答。