小编Set*_*eth的帖子

DriveApp:获取文件 ID 以及父文件夹 ID/名称和文件名

我正在尝试使用 DriveApp 来确定文件 ID:

  • 父文件夹名称或父文件夹 ID
  • 有问题的文件名

我想我会用这个: https://yagisanatode.com/2018/10/05/google-apps-script-get-file-by-name-with-optional-parent-folder-crosscheck/

但它总是返回:

有多个名为:(文件名)的文件。但它们都不在文件夹(文件夹名称)中。

...这不是真的。有什么想法或更简单的方法来做到这一点吗?

提前致谢。

这是一个最小的例子:

/*
* ****Get File By Name***
*
*param 1: File Name 
*param 2: Parent Folder of File (optional)
*
*returns: Dictionary of file "id" and "error" message {"id": ,"error": }
*  -if there is no error, "id" returns file id and "error" returns false
*  -if there is an error, "id" returns false and "error" returns type of error as a string for user to display …
Run Code Online (Sandbox Code Playgroud)

google-apps-script google-drive-api

2
推荐指数
1
解决办法
3396
查看次数