Skip to content
Discussion options

You must be logged in to vote

Hi,

module.exports = async ({ triliumScriptApi }) => {
    const {
        getNote,
        createNote,
        setNoteContent
    } = triliumScriptApi;  

Where did you get this syntax? Did you use an LLM to help you write the script?
Either way, this is incorrect due to two reasons:

  • module.exports is generally used only for widgets and not backend scripts.
  • There is no triliumScriptApi. The API resides within api and it's best to simply call api.foo.

In addition:

  • Since you are using await it means that we need an async function. But you also need to call the function in order to ensure it does something (otherwise it's just an expression).
  • createNote is a deprecated API and relatively …

Replies: 0 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by nickpagz
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants