How do I make a script that allows double click local file path to open to also embed? #6176
Replies: 2 comments 2 replies
-
I couldn't find any direct examples or documentation for embedding local images or videos into Trilium notes via scripting. Trilium scripting does allow you to create notes and expose files using custom resource providers or REST endpoints, but there isn't a documented way to programmatically embed a local file (like an image or video) directly into a note's content through a script—at least not in the official docs or recent pull requests I checked reference. If you want to automate embedding, you would likely need a script that uploads the file to Trilium as a file note, then inserts a link or embed tag into your note content pointing to that file note. However, I couldn't confirm from available sources whether this is fully supported via scripting. If you can clarify whether you want to actually upload the file into Trilium or just reference it from the local filesystem, I can try to help further! To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
-
There isn't currently a documented way to make a Trilium script that, on double-clicking a local file path, both opens the file and embeds the image or video directly into the note. The original script you referenced only opens the file externally and does not handle embedding. Trilium scripting can create notes and expose files via custom resource providers or REST endpoints, but programmatically embedding a local file into a note's content through a script isn't supported in the official docs or recent pull requests reference. A possible workaround would be to write a script that uploads the file as a file note, then inserts a link or embed tag into your note content pointing to that file note, but this process isn't fully automated or supported via scripting at this time reference. There are ongoing discussions about improving local file handling and embedding, but no direct solution exists yet. To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe feature
Hello, I've been messing around with a bunch of stuff but I saw a script from a couple years ago that allows you to paste the file path of a local video or image and then if you ctrl + double click the text open it in your pcs image or video player but I was wondering if this same script somehow would be able to be changed to also embed the image or video itself into the note? I am talking based off this script https://github.com/orgs/TriliumNext/discussions/1549. Thank you for reading!
Additional Information
No response
Beta Was this translation helpful? Give feedback.
All reactions