Bases: File Is Bookmarked

I’m trying to add a column to a newly created base that shows whether or not I’ve bookmarked each file. I can’t find anything in the bases documentation about some sort of bookmarked property, but when I’m in formula editor, it’s suggested as a autocomplete, making me think it exists somehow!

I’ve tried using it as a function, as well as file.bookmarked, both of which give me errors. Putting it by itself doesn’t return an error, but it also doesn’t return true for my bookmarked notes!

Suggestions?

Bookmarks are stored in the bookmarks.json file, located in the .obsidian folder.

Since that information isn’t part of the notes and the Bases plugin extracts all its data from the notes’ frontmatter, I don’t think it can tell if a note is bookmarked or not.

I’m guessing the autocompletion you’re seeing in the formula editor probably happens because you named your formula “bookmarked,” making that word part of the “formula vocabulary.”

The only way I can think of to implement this feature is to add a bookmarked: true boolean to the frontmatter of the bookmarked notes.

You could write a small Python script (or ask an AI to do it for you) that reads bookmarks.json, gets the list of bookmarked files, and adds bookmarked: true to their frontmatter. The script should also remove the bookmarked: true property from any file that is no longer in bookmarks.json. You would need to re-run this script every time you modify your bookmarks.

2 Likes

Ah, that’s super helpful! I’ve been thinking about doing a bunch of Python work to get my frontmatter sorted out (I’ve done exactly nothing with tags & properties up til now and it sounds like a fun project).

I like the idea of a cron job that runs that script on the regular to update it–one of my sync’d machines is my home server, so that’d be pretty trivial to set up, once I got it written reliably.

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