Closed abruneau closed 4 days ago
A js-engine
code block will run every time the note renders, which is when it's opened and when the code block is modified while the note is open. Maybe that does what you need. If not you should look into making this into a plugin. There you can easily use the file open event for this.
I tried to use the code block but when I import the js file which itself import another js file I get an error telling me that engine isn't found
let account = await engine.importJs("Scripts/test/account.js");
account.updateAccountInfo()
ReferenceError: engine is not defined
Any idea?
This is a side effect of how I declare the globals since they must be scoped to this execution only and not leak anywhere else. A simple fix is to pass the globals that you need to the function.
Hello, I'm trying to update the content of a document with a bunch of Dataview queries. I'm not using DV directly because the links reported by DV wont be visible in the map.
I'm using the following approach:
In my note I have a Meta Bind button triggering a js script. the note also contains two markdown comment
template:
The core logic of the script is the following:
It finds the two markdown comments and inserts the content I generated in between.
This is working but I'm looking for a way to automatically run this script when I open the document instead of having to click the button.
Any suggestion?