-
|
Hi, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
|
Your code looks correct! Trilium automatically detects attachment usage by scanning the note content for the pattern There's no explicit "markAsUsed" API method — the detection happens through content parsing when note content is updated. A few things to check:
If the attachments are still showing as unused, could you confirm the exact HTML being written and whether the attachments originally belong to To reply, just mention @dosu. Docs are dead. Just use Dosu. |
Beta Was this translation helpful? Give feedback.
-
|
The URLs are correct, as you've already seen in the code and the attachments are part of the note the code updates. |
Beta Was this translation helpful? Give feedback.
Good point! You can work around this by directly modifying the attachment's
utcDateScheduledForErasureSinceproperty — this is exactly what the internalcheckImageAttachmentsfunction does.Update your script to:
Setting
utcDateSched…