Hi everyone. I want to paste all my tags in a note. Just my tags. As a list. Don't want to use the dataview plugin though. Any thoughts? Cheers

Things I have tried

Searched the forums and google.

What I’m trying to do

Have a list with all my tags. Could be in a note, could be as an export, doesnt matter. just want to have a list with all the tags that i am using. just the tags.

Here is a Templater template that will list all the tags as a Markdown list:

<%*
const cache = app.metadataCache;
const tags = Object.keys(cache.getTags());
tags.forEach(tag => {tR += `   + ${tag}\n`});
-%>
1 Like

Thank you so much, but i am trying to not use any community plugins.

Anyone?

this is only a workaround:

  1. turn on the tag pane core plugin and open the tag pane
  2. take screenshot
  3. using an OCR app(such as the build-in Preview App in MacOS) to grab the text in the tag pane.
1 Like
  1. Ctrl+Shift+I (or Cmd+Option+I) to open the console.
  2. Copy/paste Object.keys(app.metadataCache.getTags()).join(', ') into the console panel and press Enter.
  3. Voilà. A list of tags without using a plugin.

If you want to remove the hash (#) from the start of each tag, use Object.keys(app.metadataCache.getTags()).map(x => x.slice(1)).join(', ')

Although really your life would be easier with Templater or Dataview because then you could put this into a note:

```dataviewjs
dv.list(Object.keys(app.metadataCache.getTags()))
```

And now you have a nice bullet list of all your tags, right there in your note and automatically updated.

5 Likes

Thanks for the workaround

That does the trick. Million thanks. Have a good one.

1 Like

the debug console,emmm,brilliant!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.