Skip to content
Discussion options

You must be logged in to vote

Hi @saitatter! I'm Dosu and I’m helping the Trilium team.

There isn’t a direct runNote API or function to execute a note’s script from another note in Trilium. Toolbar buttons can trigger backend JavaScript using api.runOnBackend, but this runs code you define in the button’s note, not in another note’s script Task Manager example.

For code reuse, Trilium supports organizing scripts as child notes (CommonJS modules). Child notes are automatically imported and their exported functions can be called from the parent note’s script discussion.

If you need to trigger backend code in another note, you can set up a custom REST endpoint using a backend JS note labeled with #customRequestHandler. …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by saitatter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant