Skip to content
Discussion options

You must be logged in to vote

@Maja-Nune Thanks for the feedback!

I was able to inspect the code for Delete footnote and reference, provided it to AI (Claude), and tweaked it to work with Note Toolbar. This code seems to work!

Try this:

  1. Create a JavaScript item
  2. Select Evaluate JavaScript
  3. Paste in this code:
const e = ntb.app.workspace.activeLeaf.view?.editor;
const f = ntb.app.workspace.getActiveFile();
if (!f) return;

const ref = e.getClickableTokenAt(e.getCursor());
if (!ref || ref.type !== 'footref') return;

const c = ntb.app.metadataCache.getFileCache(f);
const fn = c?.footnotes?.find(f => f.id === ref.text);
if (!fn) return;

e.transaction({
  changes: [
    { from: ref.start, to: ref.end, text: "" },
    {

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Maja-Nune
Comment options

Answer selected by Maja-Nune
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
script 📜 Solution available via a script item.
2 participants