generate_trigger_code
Generate Apps Script code to create automated triggers for time-based events, document actions, or form submissions when the Apps Script API cannot create them directly.
Instructions
Generate Apps Script code for creating triggers.
The Apps Script API cannot create triggers directly - they must be created from within Apps Script itself. This tool generates the code you need.
Args: trigger_type: Type of trigger. One of: - "time_minutes" (run every N minutes: 1, 5, 10, 15, 30) - "time_hours" (run every N hours: 1, 2, 4, 6, 8, 12) - "time_daily" (run daily at a specific hour: 0-23) - "time_weekly" (run weekly on a specific day) - "on_open" (simple trigger - runs when document opens) - "on_edit" (simple trigger - runs when user edits) - "on_form_submit" (runs when form is submitted) - "on_change" (runs when content changes)
Returns: Apps Script code to create the trigger. User should add this to their script and run the setup function once to install the trigger.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| trigger_type | Yes | ||
| function_name | Yes | ||
| schedule | No |