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 日曆中建立、更新或刪除活動時,觸發條件就會觸發。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-26 (世界標準時間)。
[null,null,["上次更新時間: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. |"]]