Open an existing note with today's date on it

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

If anyone has any ideas please let me know. Thanks!

Here is a shortcut I use for a Bear daily note.

https://www.icloud.com/shortcuts/66ac60294e254c948761f09db1b68938

There is an actual setting in Bear settings to start a new note with date (and optionally the time as well)

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.

But it is giving me an “Invalid URL” error.
:frowning: I’m not very good at these shortcuts…

Not, really what I am looking for. But thanks!

@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.

2 Likes

Wow! That’s it… so simple. Sorry for back-and-forth.

1 Like

I’m not great at shortcuts either but Bear makes it easier with excellent shortcut actions

1 Like

Yes, I did wonder about this - probably need to add some year syntax to the note titles.

1 Like

Just deleted my responses since your shortcut was the simplest one :blush:

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.

2 Likes

Tip: Use BetterTouchTool to assign a handy keyboard shortcut to this.

I use Fn+T.

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.

The original question is about how to open an existing note, yet all of the solutions are about creating a new note.

I want to use Keyboard Maestro to open an existing Bear note using a Regular Expression match to the title.

Any ideas?

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.

I got some generous and serious help with this on the Keyboard Maestro forum.
Macro to Find a Bear Note with a RegEx?

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.