Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-apps-script/5.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
Events 使用应用程序脚本检测谷歌电子表格中的背景颜色变化_Events_Google Apps Script_Google Sheets - Fatal编程技术网

Events 使用应用程序脚本检测谷歌电子表格中的背景颜色变化

Events 使用应用程序脚本检测谷歌电子表格中的背景颜色变化,events,google-apps-script,google-sheets,Events,Google Apps Script,Google Sheets,我在谷歌应用程序脚本中创建了一个onEdit()触发器,但它只在我更改单元格的值时起作用;当我改变背景颜色时就不会了。如何修复它?注意:onChange(e)报告它不工作时存在一个未决问题。看 使用onChange(e)代替onEdit(e)。当改变单元格的背景时,e.changeType的值将为FORMAT function onChange(e) { // Show a popup with a message showing the type of change. Sprea

我在谷歌应用程序脚本中创建了一个
onEdit()
触发器,但它只在我更改单元格的值时起作用;当我改变背景颜色时就不会了。如何修复它?

注意:onChange(e)报告它不工作时存在一个未决问题。看


使用onChange(e)代替onEdit(e)。当改变单元格的背景时,e.changeType的值将为FORMAT

function onChange(e) {
   // Show a popup with a message showing the type of change.
   SpreadsheetApp.getActiveSpreadsheet().toast(e.changeType);
}
参考资料


这是不可能的,请参见:背景颜色如何变化?来自代码?用户改变了吗?谢谢伙计们,我怀疑是这样的。我只是希望从2012年到2015年,谷歌团队在这方面取得了一些进展!颜色已由用户更改。这不再有效。
onChange
是否已贬值?@xu信任:onChange(e)存在一个未决问题。我在我的回答中添加了一条注释,其中包括一个问题的链接。