[Solved] How to bulk convert RTF files to .txt ones?

I found this post, but couldn't figure what are exact action steps and what if we have to convert RTF to .txt

I want to have extra copies of my existing RTF files as .txt files.

Why I am doing this? because, all my text files are on iCloud and I wish to edit them easily from iPhone as well. The iOS app that I am using shows text in weird way if the file is RTF document. I did not know textedit default app make RTF documents instead of .txt files.

In the post that you cite above, there was an explanation that went like this:

Those are the steps for manually fixing this problem. Were these steps not clear, or are you trying to create a macro that will do it automatically instead of manually?

I presume you have found a way to stop creating RTF files, right? Or are you trying to come up with a macro that fixes this problem every time you create an RTF file? I'm not clear if the problem is that you want a macro that fixes the problem every time it occurs, or if you are just trying to fix the problem once and you will make sure it won't happen again.

The method is the same, you just change the textutil flags to do RTF to text (rather than, as written, text to RTF).

You can see the flags for yourself by entering man textutil in Terminal, but try

textutil -format rtf -convert txt *.rtf

...to convert all the RTF files in the current working directory.

As with any bulk conversion, work on copies first until you are happy with how it works!

Yes, i didn't understand if this is to be executed in terminal or this is shell script or apple script.

I am scared to use terminal commands because I would have no idea how to fix if something goes wrong.
Moreover if this is shell or apple script, how do I design the actual macro? How do i put 'for each' action for each RTF document file in specific folder?

I am just going to paste a blank text file each time I want to create a new text file. So, yes, i would not need to convert to .txt each time.

Hi Nige,
Nice to see you again here.

Thanks for explaining what needs to be changed in the code.

However I am not sure how to execute it.

I don't know how you are choosing your files, but this will work on the current Finder selection. It's also non-destructive, so your originals are safe.

RTF files to TXT.kmmacros (1.8 KB)

It looks like Nige has given you a sample macro that should solve your problem whenever the problem exists.

1 Like

Yes Nige. Works perfectly. Thank you.