将文件保存到Google云端硬盘后,是否可以触发Google脚本? [英] Can I trigger a Google Script when a file is saved to Google Drive?

查看:57
本文介绍了将文件保存到Google云端硬盘后,是否可以触发Google脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个VBA脚本,可以将Excel文件转换为PDF,然后通过Google Drive桌面同步将其保存到Google Drive文件夹中.

I have a VBA script which converts an Excel file to a PDF then saves it to a Google drive folder via Google Drive desktop sync.

然后我想做的是让Google脚本触发器监视给定的文件夹,并且每次将文件保存到那里时,它都会运行一个脚本来通过电子邮件发送文件.我每15分钟运行一次基于时间的触发器时脚本运行良好,但是希望使用实时解决方案.

What I would like to do is then have a Google script trigger monitor the given folder and each time a file is saved there it runs a script to email the file. I I have the script working fine when running on a time based trigger, every 15 minutes, but would prefer a realtime solution.

因此,我很喜欢onChange()触发器,但适用于Google云端硬盘.

So i'm after like a onChange() trigger but for Google Drive.

可能吗?

谢谢

推荐答案

GAS当前无法实现这种脚本触发.您必须运行一个基于时间的脚本,该脚本会不断进行检查.

That kind of script trigger is not currently possible with GAS. You'll have to run a time-based script which keeps checking.

这篇关于将文件保存到Google云端硬盘后,是否可以触发Google脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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