Here’s one approach you might consider.
Create an action with a single script step and put the script below into it. It would then be a case of building out the script to meet your particular requirements.
If you look at the lines starting
replaceAll, I’m sure you’ll get the gist of what it is doing, but you just need to produce a big list of what you want to find (first parameter) and what it should be replaced by (second parameter).
I’ve pre-populated the script with smart quotes, em dashes, and a couple of HTML entity examples.
//Define a text replacement function
function replaceAll(p_strFind, p_strReplace)
let reReplace = new RegExp(p_strFind,"g");
draft.content = draft.content.replace(reReplace, p_strReplace);
//Replace left and right smart quotes with straight quotes
//Replace em-dash with two hyphens
//Replace ampersand HTML entity with an ampersand
//Replace copyright HTML entity with a copyright symbol
Expand for some extra info
I suspect the
draft.update() step might not even be required here, and be applied implicitly at the end. If you find the script becomes slow to run due to complexity and text volume, it might be worth testing without that line in. I think it would only potentially be an issue if you perhaps had an overlap in replacements and then the ordering would become important too.
Of course if you need to actually include anything that the script is automatically replacing for a particular article (e.g. one about replacing text ) , you would need to reapply the details afterwards or forego using the script.
Hope that helps.
BTW, I’d suggest posting queries like this as a new topic as it is only tangentially related to this text transform group and then further discussion around your particular request won’t deviate the original topic.