google-apps-script - 返回与特定用户共享的 Google Drive 文件集合
问题描述
我正在尝试获取用户(让我们使用billyTheUser@gmail.com
)是编辑器的文件集合。
我知道这可以通过to:billyTheUser@gmail.com
在驱动器搜索栏中搜索几乎立即在谷歌驱动器的前端完成。
我认为这可以在Google App Scripts中完成,但也许我错了。我认为DriveApp.searchFiles会起作用,但我在构建正确的字符串语法时遇到了麻烦。我查看了Google SDK 文档in
并猜测我在使用匹配到用户字符串搜索时做错了什么?以下是我采用的方法,但是如果有不同的方法可以按用户完成文件收集,我很乐意改变我的方法。
var files = DriveApp.searchFiles(
//I would expect this to work, but this doesn't return values
'writers in "billyTheUser@gmail.com"');
//Tried these just experimenting. None return values
'writers in "to:billyTheUser@gmail.com"');
'writers in "to:billyTheUser@gmail.com"');
'to:billyTheUser@gmail.com');
// this is just a test to confirm that some string searches successfully work
'modifiedDate > "2013-02-28" and title contains "untitled"');
解决方案
尝试将子句中的操作数翻转in
为:
var files = DriveApp.searchFiles('"billyTheUser@gmail.com" in writers');
推荐阅读
- vim - 重新关注在启用鼠标的情况下运行 vim 的 tmux 会话后 tmux 崩溃
- reactjs - useState 与 useReducer
- javascript - Gracenote API 调用以获取节目/节目
- javascript - 如何为我的谷歌图表列设置数据类型?
- gwt - Gwt Material Design:MaterialSlider 在经典开发模式下不工作
- pandas - 如何迭代数据框列中的列表项
- haskell - catamorphical 函数 要么 aa -> a?
- xquery - Xquery 替换具有前缀的元素值
- python - Python,硒 find_element_by_link_text 不起作用
- python - 安全复制文件python程序 - 代码中有什么问题