mirror of
https://github.com/zadam/trilium.git
synced 2024-12-25 00:34:08 +08:00
Page:
Events
Pages
Advanced showcases
Anonymized database
Apache proxy setup
Archived notes
Attachments
Attribute inheritance
Attributes
Backup
Book note
Bookmarks
Canvas note
Cloning notes
Code notes
Custom request handler
Custom widget
Data directory
Day notes
Default note title
Desktop installation
Docker server installation
Document
ETAPI
Error logs
Events
Evernote import
FAQ
Frontend Basics
Home
Images
Keyboard shortcuts
Kubernetes server installation
Link map
Links
Manual server installation
Markdown
Mobile frontend
Nginx proxy setup
NixOS server installation
Note hoisting
Note map
Note navigation
Note revisions
Note
Onenote
Packaged server installation
Patterns of personal knowledge base
Privacy policy
Promoted attributes
Protected notes
Read only note
Relation map
Release notes v0.48
Saved search
Screenshot tour
Script API
Scripts
Search
Server installation
Sharing
Sorting
Synchronization
TLS configuration
Task manager
Template
Text notes
Theme Gallery
Themes
Tree concepts
Tree manipulation
Troubleshooting
Upgrading Trilium
Web clipper
Weight tracker
Widget Basics
Workspace
No results
10
Events
zadam edited this page 2023-11-02 23:27:34 +01:00
Table of Contents
Script notes can be triggered by events. Note that these are backend events and thus relation need to point to the "JS backend" code note.
Global events
Global events are attached to the script note via label. Simply create e.g. "run" label with some of these values and script note will be executed once the event occurs.
run
frontendStartup
- executes on frontend upon startupmobileStartup
- executes on mobile frontend upon startupbackendStartup
- executes on backend upon startuphourly
- executes once an hour on backenddaily
- executes once a day on backend
Entity events
Other events are bound to some entity, these are defined as relations - meaning that script is triggered only if note has this script attached to it through relations (or it can inherit it).
runOnNoteCreation
- executes when note is created on backendrunOnNoteTitleChange
- executes when note title is changed (includes note creation as well)runOnNoteContentChange
- executes when note content is changed (includes note creation as well).runOnNoteChange
- executes when note is changed (includes note creation as well)runOnNoteDeletion
- executes when note is being deletedrunOnBranchCreation
- executes when a branch is created. Branch is a link between parent note and child note and is created e.g. when cloning or moving note.runOnBranchChange
(since v0.62) - executes when a branch is changed - either expanded status or prefix are changed.runOnBranchDeletion
- executes when a branch is delete. Branch is a link between parent note and child note and is deleted e.g. when moving note (old branch/link is deleted).runOnChildNoteCreation
- executes when new note is created under this noterunOnAttributeCreation
- executes when new attribute is created under this noterunOnAttributeChange
- executes when attribute is changed under this note
- Screenshot tour
- Basic concepts
- Installation & setup
- Advanced usage
- Developer guides
- FAQ
- Troubleshooting
Back to Overview