Google Apps脚本驱动器文件:如何获取上次修改文件的用户? [英] Google apps script drive file: How to get user who last modified file?

查看:56
本文介绍了Google Apps脚本驱动器文件:如何获取上次修改文件的用户?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要获取文件的最后更新日期,可以调用getLastUpdated()

To get the date a file was last updated you can call getLastUpdated()

我如何获得用户,谁是上次在Google Apps脚本代码中更新的用户?

How to I get the user who did this last update in google apps script code?

我试图在列出修订版本下的下运行代码高级驱动器服务

var revisions = Drive.Revisions.list(fileId);

但我明白了

ReferenceError: "Drive" is not defined.

推荐答案

https://developers.google.com/apps-script/guides/services/advanced

在资源>高级Google服务中,打开云端硬盘API ...

In Resouces > Advanced Google services, turn on Drive API...

在同一窗口中>单击Google Developer's Console >>启用Drive API和Drive SDK ...

In that same window > click Google Developer's Console >> enable both Drive API and Drive SDK...

然后...

Drive.Files.get('<FILEDID>').lastModifyingUser

这篇关于Google Apps脚本驱动器文件:如何获取上次修改文件的用户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆