How to repeat the same series of Search & Replace steps over and over again?

I like using Find and Replace | Drafts User Guide to perform a series of Find & Replace steps. (I find the regular expression thing very powerful.)

however it is laborious to do the same 10 or so steps over and over again (they are always the same).

I would quite like to make my own “action” (like people have made in the actions directory) but it looks very intimidating / confusing.

Details

Here are a few of the Search & Replacements I make using regular expressions

The “replace” field is always blank (i want to delete the found thing)

  1. Find: ORDER PLACED[\s] ; replace: (blank)
  2. Find: TOTAL[\s\s] ; replace: (blank)
  3. Find: \[View order details \]\(.* ; replace: (blank)
  4. Find: \[Archive order\]\(.* ; replace: (blank)

The remaining six steps are all like that. One or two are strings (instead of regex)

Can someone please make me a template Action to show me how it’s done? I can then add my adapt it / use it as a template.

I’m very sorry if this request seems ridiculous or super easy to you. I find it hard.

Use a script action, e.g. like Creating an action to replace ☐ with [ ]? - #2 by sylumer

wait, Drafts has its own scripting language??! it looks like Javascript but it has draft. ?!

thats insane!

Drafts includes a complete JavaScript runtime based on JavaScriptCore. Scripts are executed by including script action step in actions.

The JavaScript implementation is compatible with ECMAScript 6, and supports all general JavaScript language libraries for working with basic datatypes, such as strings, numbers, dates, arrays, and objects. The runtime is not a browser-based runtime, and does not contain DOM scripting capabilities.