Mass Find & Replace

I imported hundreds of notes from Apple Notes. They all came in with a lot of HTML tags. Specifically:
<br>
<div>
</div>

Is there a way to mass find and replace ALL my notes? I’ve been doing it one by one and it’s getting tedious. Thanks!

you can build your own action to do this.
when you go to scripting.getdrafts.com you can have a look which APIs are available in scripts.

you actually need a few steps:

  1. a prompt to define the search and replace string
  2. query for all your drafts
  3. iterate through all drafts and replace in each the search string with the replace string in each of them.

If you’re not able to script this by yourself I can have a look.

BE CAREFULL WHEN TESTING YOUR SCRIPT SINCE YOU WOULD MAKE CHANGES TO ALL OF YOUR DRAFTS

I suggest to test it e.g. on a “testing” tag and see if it works like you expect.

You need to wrap your HTML in triple back ticks (a code block) otherwise the forum software will not display it.

It may also be worth reviewing your export process. Often addressing such issues at the source is the best approach to a neat and reliable solution.

1 Like

Okay. Thank you. I will give it a bash myself, failing which, I’ll chase you up, or hound you down, as the case may be… :slightly_smiling_face:

Always check the Directory, too. There are some global find and replace examples. If they don’t work for you as-is, they might be a good starting point at least.