Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/google-sheets/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google apps script 应用程序脚本等待公式完成_Google Apps Script_Google Sheets_Google Sheets Formula_Spreadsheet - Fatal编程技术网

Google apps script 应用程序脚本等待公式完成

Google apps script 应用程序脚本等待公式完成,google-apps-script,google-sheets,google-sheets-formula,spreadsheet,Google Apps Script,Google Sheets,Google Sheets Formula,Spreadsheet,我的电子表格运行应用程序脚本,该脚本在电子邮件中发送范围值 我使用睡眠15秒,以避免在简单公式完成之前发送邮件 然而,邮件有时发送得太早 邮件是异步发送的,所以我不关心脚本运行的时间 如何运行应用程序脚本的等待通知?我怎样才能在公式完成后发送电子邮件 试试SpreadsheetApp.flush()。我不确定这是否有用,因为我从不使用公式。我的另一个答案是不用公式进行计算,然后你就会知道你什么时候完成了!如果@MetaMan评论的方法在您的场景中无效,请共享您的代码和一些用例,以便我们都可以查看

我的电子表格运行应用程序脚本,该脚本在电子邮件中发送范围值

我使用睡眠15秒,以避免在简单公式完成之前发送邮件

然而,邮件有时发送得太早

邮件是异步发送的,所以我不关心脚本运行的时间

如何运行应用程序脚本的等待通知?我怎样才能在公式完成后发送电子邮件


试试SpreadsheetApp.flush()
。我不确定这是否有用,因为我从不使用公式。我的另一个答案是不用公式进行计算,然后你就会知道你什么时候完成了!如果@MetaMan评论的方法在您的场景中无效,请共享您的代码和一些用例,以便我们都可以查看并帮助您。