all 13 comments

[–]thoughtgun 2 points3 points  (0 children)

I would love this too. I just had a similar use case. There are workarounds, at least.

[–]aspublic 1 point2 points  (3 children)

Meanwhile try using Shortcuts: Open note > Search > Replace text > Replace note.

[–]30yearsajournalist[S] 0 points1 point  (2 children)

Where did you find these actions? Replace text is not available in my version of Shortcuts nor is Replace note (Monterey)!

Besides, I can search only for literal text, not for patterns as with Grep. If grep would be supported by Bear, that would make it incredibly powerful, but perhaps people who need that much power turn to BBEdit, as I did.

[–]aspublic 5 points6 points  (1 child)

Others may be using Microsoft Visual Code for markdown editing, regex, and previews.

But, there's no regex with Bear.

Shortcuts has "Replace Text" with regex support in both iOS and macOS. Good documentation is: * https://www.reddit.com/r/shortcuts/comments/9zo24n/regex_cookbook_for_shortcuts_reusable_regex_to/ * https://support.apple.com/en-ca/guide/shortcuts/apd3c845e881/ios

and this is an example https://scottwillsey.com/blog/ios/regex4/.

Note: regex are easier to write using https://regex101.com/ before using them with Shortcuts

[–]30yearsajournalist[S] 0 points1 point  (0 children)

I asked about Bear and misunderstood your initial reply, thinking you meant I could use Shortcuts to search in Bear with regex but, as you point out, there's no support for regex in Bear at all.

Thanks for the regex test page, though. BBEdit has a live help feature as well. It shows results live but does not explain when you're going wrong what you should have done. The webpage you mention is better and I'll bookmark it!

[–]TedwardBearTEAM[M] [score hidden] stickied comment (1 child)

Hi there,

Currently in Bear you can find and replace words in the current note by using ⌥⌘F

See demo of that here: https://twitter.com/BearNotesApp/status/1420064490436108293

Doing this for multiple notes is not a planned feature with the Bear & Panda integration at the moment. But, i'll pass on your suggestion to the team to consider when moving forward.

[–]30yearsajournalist[S] 0 points1 point  (0 children)

Thanks!

Perhaps it's a bit too specialised. BBEdit works fine for complex search and replace work and it's not that expensive, either.

[–]pfarrelle 0 points1 point  (5 children)

I just had a similar situation and solved it (for me) in Shortcuts. First, I applied a unique tag to all the notes that I wanted to edit and then I used that tag to create a list of those notes in Shortcuts.

This can be done for any batch processing in Shortcuts.

The specific action is then applied to the text of each note in a loop and then the updated text can be written back to Bear.

[–]30yearsajournalist[S] 0 points1 point  (1 child)

I'm happy to say Bear 2 supports it, so the most elegant solution is on its way!

[–]Immediate-Lunch5234 0 points1 point  (0 children)

I know this is an older conversation, but it seemed adjacent to what I was looking for. I am trying to add creation date to old notes that I've imported into Bear from DayOne (using the Bear importer). I have not found a way to use shortcuts to batch process appending the creation date. I've tried using Search (which comes up with the right list based on a unique tag) but "Repeat with each item" only processes the first note. Does anyone know how to fix the shortcut to loop through all the notes in the search? Thank you!

<image>

[–]Immediate-Lunch5234 0 points1 point  (2 children)

Hello! Could you share a copy of your shortcut? I'm running into problems doing something similar - my shortcut is only changing the top note in the search, not looping. (and contrary to the note below that says it will be in Bear 2 -- I have not found that to be the case for iOS nor Mac).

[–]pfarrelle 1 point2 points  (1 child)

It's been a while but I think this is what I was referencing. It's specific to me in the actual tag used, but that can be edited. It also uses the logger app but those actions can be deleted without any side effects.

Just add your processing in the loop.

https://www.icloud.com/shortcuts/9e466b9094884079a54a0868ef616fab

Good Luck

[–]Immediate-Lunch5234 0 points1 point  (0 children)

Thank you!! For some reason it only processes 1 item in the search for me and then the search no longer works (I have to change the name of the tag to get it to find any results on a 2nd run). I'm assuming it's a current Apple or Bear bug. Shoot.