Mac's textutil to convert from/to RTF and DOCX

Hi,

The CAT software I use can’t read RTF sources. It works fine with ODT and DOCX files.

My plan is to export collections of RTF files from Scrivener, and then use Mac’s textutil utility to batch convert them to DOCX. When the translation is done, I would like to use textutil again to convert the DOCX files to RTF, and then drag them in Scrivener’s Binder.

What is your experience with this conversion? Is there something that is removed/scrambled, when doing it?

Paolo

I naively dragged a DOCX file into a new document under “Drafts” in the Binder, and it just worked. This suggests to me that you don’t need to convert the DOCX files to RTF.

Perhaps do a dry run of your planned process and test for issues?

1 Like

Why not use the compile function on those collections of files, and output from Scrivener to ODT or DOCX directly?

If you set up your compile with a separator that can be easily searched, there’s a Scrivener import menu called “import and split”, that will automatically split up a file as it’s imported . I’d look at that first, maybe even experiment with a test project.

It’s also pretty easy to manually split things up after you import to a single file though. There’s a keyboard shortcut/menu item for that.

2 Likes

Scrivener’s File → Export → Files command will export as DOCX. And then the File → Import → Files command will convert them back.

Recent versions of Scrivener use our own DOCX converter, which should give better results than the Mac OS converter in most cases.

1 Like

Ouch! I had forgotten that option in the Export window! Thank you for reminding it to me!

I find it very useful that the Export and Import commands preserves the structure of folders of the original Scrivener project. I deal with very complex projects, and knowing where each section is, in particular when dealing with languages I don’t know, is of great help.

Paolo

Looks like you’ve got it sorted with the optional docx export. But In case you weren’t aware (or if others reading this thread aren’t), there is a compile setting that inserts links back to the documents that make up the compiled output. So with a single click in your Word document, that section will open in the original Scrivener project.

3 Likes

Although the conversation has gone toward more productive solutions, in answer to the original question: while using textutil might seem tempting, given it is a command-line tool and can thus be automated, it’s worth considering that we:

  • Paid who knows how much in yearly licensing fees for years to embed a converter in Scrivener, and bloated Scrivener’s installation size to embed an entire Java distribution to run it.
  • Spent months writing and refining a hand-coded DOCX converter to…

…avoid having to depend upon Apple’s RTF to DOCX and ODT conversion utilities. :slight_smile: They are pretty mediocre.

I suppose for very simple documents they might be okay, but expect to lose your images, some kinds of paragraph formatting, maybe even footnotes/endnotes, and so on.

1 Like