Programmatically Create Note In Current Workspace #3596
Replies: 2 comments
-
Update: I have come up with a bit of a sketchy solution for the mean time by getting the parent of each of the notes tagged with
I am hoping to find a legitimate solution that could let me just select the workspace root or something similar. |
Beta Was this translation helpful? Give feedback.
-
Hi, try api.searchForNotes('#lectureRoot', {
ignoreHoistedNote: false
}); This should search within the currently hoisted tree (= workspace). |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I am currently trying to create a single button I can use to create templated notes for my classes. I use workspaces to keep all of my work for each of my classes separate; 1 workspace for each class. However, I would like to use a single button to create a new note for whichever workspace I currently have open.
Here is the code I have so far:
As you can see, I am finding the rootNote for the lectures by calling the frontend
api.getActiveContextNote();
. I would rather automatically select the root by using a label such as#lectureRoot
through the backend. When I have tried this by callingI have found that Trilium does correctly select a note with that label, however the note is located in a different, unhoisted workspace. Is there any way to search for notes that are only present in the currently hoisted workspace?
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions