Hi, I import some files from a website and convert it to markdown.
But, in some files I have a special Character ( † ) that I would like to remove.
I try to find it and replace for an empty space, but it works just when I open each file (one by one).
Somebody has suggestions to solve that problem?
If it’s just a small number of files, it would be best to do them document by document.
You could set up a Smart Rule—if you are not using a Smart Rule for converting the websites to Markdown anyway—that executes a script like this:
-- Remove characters from plain text
tell application id "DNtp"
repeat with theRecord in theRecords
set theText to plain text of the theRecord
set theText to my findAndReplaceInText(theText, "( † )", "")
set the plain text of theRecord to theText
on findAndReplaceInText(theText, theSearchString, theReplacementString)
set AppleScript's text item delimiters to theSearchString
set theTextItems to every text item of theText
set AppleScript's text item delimiters to theReplacementString
set theText to theTextItems as string
set AppleScript's text item delimiters to ""
Please note that while it will work with plain text like Markdown it would break RTF.
I use a free tool called “MassReplaceIt” to change multiple text files.
The files should be in a regular mac folder, so import to DevonThink after replacement.
For me this works very well.
It is some many documents. MassReplaceIt solve the problem. Tks.