问题描述
我有一个 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 Drive.
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 Drive 时,我可以触发 Google Script 吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!