Good day everyone.
I really love the framework called https://www.myforevernotes.com
I have notes created with date titles like this: “3 November” , “10 November” , “11 November”, etc.
There is a shortcut that works with Apple notes and I would like to try to recreate it for Bear. The link to the Shortcut is here: Shortcuts
So here is the shortcut I am trying out… but it isn’t working.
The problem isn’t creating a note with the date. I want to create a shortcut to open pre-existing notes with dates on them.
@neilg3 Have you tried the Bear specific shortcuts rather than x-callback?
You could use the ‘Open Bear Note’ shortcut action with the current date custom formatted as the title - it’s a single action and will open today’s (titled) note.
Just deleted my responses since your shortcut was the simplest one
I also thought it would be better to include year in title, but I tested the shortcut as it is, and it will open the last edited one when duplicate note titles (next years).
So guess it’s ok if one wants a clean title.
But adding tags like #journal/2024 or something could also remedy that.
I used to use Alfred, and now Keyboard Maestro, for a quick text action that creates a YYYY-MM-DD-hhss header and a #Journal/YYYY/MM tag at the bottom (below a horizontal rule).
I use !entry for the replacement action. Works perfectly.
I can’t think of a way to use a RE for a search in Bear via API or UI. I don’t use Keyboard Maestro and I’m unsure if you can apply this to your workflow but maybe you can use Bear’s /search to get an unrefined set of results as JSON and then use the RE on the same data.
The built-in Bear API requires either a Note UUID or the complete and exact title of a Note to be able to identify it in the database. Which is, of course, why I was looking for a way to search by Regular Expression. Fortunately the Bear database is in SQL3 format (I think that’s the right term) and folks on the KBM forum helped me with finding SQL tools and queries to extract the info that I am looking for – including searching by Regular Expression, which turns out to b e a built-in tool in the SQL query app.
Bear Doc and the KBM folks emphasized that it would not be safe to attempt to make changes to the Bear database with SQL, so I’m just using SQL, wrapped in a KBM macro, to get the desired Note UUID and the updated it using the actions of the Bear API.
As far as the OP is concerned, this method, using KBM or AppleScript or a Shell or whatever to use SQL to get the Note ID of a note with today’s date using a Regular Expression to find it, and then using that ID to open it, should work.