update_os_event()
Updates the script code — and optionally the scripting language — of an existing
OsEvent via dms.UpdateOsEvent.
|
The script code ( |
1. Signature
-
Sync
-
Async
ecm.system.update_os_event(
os_event_id: int,
script: str,
*,
is_js: bool | None = None,
) -> None
await ecm.system.update_os_event(
os_event_id: int,
script: str,
*,
is_js: bool | None = None,
) -> None
2. Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
|
|
— |
Id of the event to update (the |
|
|
— |
The new script code (JavaScript or VBScript). Sent to the server as UTF-8 with a leading byte-order mark (BOM); the server detects the BOM and stores the full Unicode range. |
|
|
|
Switches the scripting language: |
4. Examples
-
Sync
-
Async
ecm.system.update_os_event(9, "'updated script")
# switch the event to JavaScript
ecm.system.update_os_event(9, "// updated script", is_js=True)
await ecm.system.update_os_event(9, "'updated script")
# switch the event to JavaScript
await ecm.system.update_os_event(9, "// updated script", is_js=True)
5. See also
-
get_os_events() — list events.
-
create_os_event() — create an event.
-
delete_os_event() — delete an event.
-
refresh_server_events() — activate events without a server restart.