Enum EventType
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
事件类型
表示触发的事件类型的枚举。
如需调用枚举,您可以调用其父类、名称和属性。例如
ScriptApp.EventType.CLOCK
。
属性
属性 | 类型 | 说明 |
CLOCK | Enum | 当基于时间的事件达到特定时间时,触发器会触发。 |
ON_OPEN | Enum | 当用户打开 Google 文档、表格或表单文件时,触发器会触发。 |
ON_EDIT | Enum | 当用户修改 Google 表格文件(例如,在单元格中输入新值,这会计为修改而非更改)时,触发器就会触发。 |
ON_FORM_SUBMIT | Enum | 当用户回复 Google 表单时,触发器就会触发。此触发器可在 Google 表单本身或表单将回复发送到的 Google 表格文件中使用。 |
ON_CHANGE | Enum | 当用户更改 Google 表格文件(例如,通过添加行,这会计为更改而非修改)时,触发器就会触发。 |
ON_EVENT_UPDATED | Enum | 在指定 Google 日历上创建、更新或删除活动后,触发器就会触发。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003e\u003ccode\u003eEventType\u003c/code\u003e is an enumeration used to define the type of event that triggers a script to run.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eEventType\u003c/code\u003e enum includes properties such as \u003ccode\u003eCLOCK\u003c/code\u003e, \u003ccode\u003eON_OPEN\u003c/code\u003e, \u003ccode\u003eON_EDIT\u003c/code\u003e, \u003ccode\u003eON_FORM_SUBMIT\u003c/code\u003e, \u003ccode\u003eON_CHANGE\u003c/code\u003e, and \u003ccode\u003eON_EVENT_UPDATED\u003c/code\u003e, each corresponding to a specific event trigger.\u003c/p\u003e\n"],["\u003cp\u003eTo call an enum property, use the syntax \u003ccode\u003eScriptApp.EventType.PROPERTY_NAME\u003c/code\u003e, replacing \u003ccode\u003ePROPERTY_NAME\u003c/code\u003e with the desired event type (e.g., \u003ccode\u003eScriptApp.EventType.CLOCK\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eThese event triggers allow scripts to automatically execute in response to various actions within Google Apps like Docs, Sheets, Forms, and Calendar.\u003c/p\u003e\n"]]],[],null,["# Enum EventType\n\nEventType\n\nAn enumeration denoting the type of triggered event.\n\nTo call an enum, you call its parent class, name, and property. For example, `\nScriptApp.EventType.CLOCK`. \n\n### Properties\n\n| Property | Type | Description |\n|--------------------|--------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `CLOCK` | `Enum` | The trigger fires once the time-driven event reaches a specific time. |\n| `ON_OPEN` | `Enum` | The trigger fires once the user opens the Google Docs, Sheets, or Forms file. |\n| `ON_EDIT` | `Enum` | The trigger fires once the user edits the Google Sheets file (for example, by entering a new value into a cell, which counts as an edit instead of a change). |\n| `ON_FORM_SUBMIT` | `Enum` | The trigger fires once the user responds to a Google Form. This trigger is available either in the Google Form itself or in the Google Sheets file that the form sends its responses to. |\n| `ON_CHANGE` | `Enum` | The trigger fires once the user changes the Google Sheets file (for example, by adding a row, which counts as a change instead of an edit). |\n| `ON_EVENT_UPDATED` | `Enum` | The trigger fires once an event gets created, updated, or deleted on the specified Google Calendar. |"]]