1 July 2018
How to prevent italics going missing when importing a Word file into InDesign
One of our clients emailed last week to see if I had an answer to the problem of italics dropping out of Word files when imported into InDesign. “Sometimes it just affects a few random book titles,” they reported, “sometimes all book titles in one chapter.”
We’ve probably all been there. There’s nothing more soul-destroying than having to open up Word and search the whole file for each instance of italic in turn and manually reapply it in InDesign, flipping between Word and InDesign all the while. And if the italics are shot, then the bolds, bold italics and other local formatting will probably need to be searched and redone as well.
And all this even though “Preserve Local Overrides” has been checked in InDesign’s import preferences:
It’s not a new problem, as this inconclusive 2010 discussion on InDesignSecrets demonstrates.
But whereas David Blatner and his correspondents ponder preliminary find/change routines in Word involving character styles and other convoluted techniques, it turns out there’s a much simpler workaround we’ve found to be robust in production over the past couple of years:
- Open the Word file in Word
- Save it as RTF
- Import the RTF file into InDesign instead of the original Word file
Hat tip: Special thanks to Ian Spick at Bradt Travel Guides for first alerting me to this technique.
Adapting and automating the process
If you’re given a project with a separate Word file for each chapter, however, it’s also soul-destroying to have to do this manually on each file individually, so creating an AppleScript droplet to batch process files was the obvious next step.
This also gave us the chance to fix other annoying problems, so the full workflow is:
- Open the Word file in Word
- Search and replace hidden characters that have caused problems in the past, and which for some reason I couldn’t search and replace in InDesign
- Accept all revisions (I’ve had both versions of the text come through in InDesign before now, if a tracked change is still pending)
- Convert any endnotes to footnotes (not such an issue with the latest InDesign, but still useful for earlier versions)
- Save as RTF (to import into InDesign)
- Save as PDF (Adobe Reader being more convenient than Word to refer to for formatting in lieu of hard copy if working digitally)
- Display a notification when done
and the AppleScript code inside the droplet is:
on open these_items set myScriptName to name of me set myFormattedDate to do shell script ("php -r 'echo @date(\"Y-m-d\");'") tell application "Microsoft Word" to launch repeat with this_item in these_items tell application "Finder" to set target_path to (container of this_item) as text set item_info to info for this_item set filename to text 1 thru ((length of name of the item_info) - (length of name extension of the item_info) - 1) of name of the item_info set my_output to target_path & filename & "." & myFormattedDate & ".rtf" set my_PDF to target_path & filename & "." & myFormattedDate & ".pdf" tell application "Microsoft Word" open this_item -- search and replace routine from http://macscripter.net/viewtopic.php?id=29566 set docRange to text object of active document clear formatting of find object of docRange execute find (find object of docRange) find text "^-" replace with "" replace replace all -- optional hyphen if (count of revisions of active document) ≥ 1 then accept all revisions active document set myEndnotes to (get endnotes of active document) if (count of myEndnotes) > 0 then endnote convert endnote options of active document save as active document file name my_output file format format rtf save as active document file name my_PDF file format format PDF close active document saving no end tell end repeat set myMessage to "Done!" display notification myMessage with title myScriptName delay 1 --> allow time for the notification to trigger end open
To save this and use it on your own computer (Mac-only I’m afraid):
- Highlight and copy the script code above
- Open Script Editor (
Applications > Utilities > Script Editor.app)
- Make a new file, if one hasn’t been started on opening Script Editor
- Paste the script code into the new file
File > Save…
- Name the file “MS Word document prep” and set “File Format” to “Application”
- Save the file somewhere handy
To use it, just drag-and-drop one or more Word files onto
MS Word document prep.app. The RTF and PDF files will both be appended with a date stamp in the format
2018-07-01, and saved in the same folder as the original Word file.
A few things to consider:
- The structure of the AppleScript should be self-explanatory, so if you don’t want any of the extra features then just edit them out in Script Editor and re-save the script.
- For an introduction to creating and saving AppleScripts with Script Editor, see this useful primer from Doug Adams.
- Every once in a while the script might hang, and there’s no option but to force quit both it and Word. I don’t know why this happens, so it’s just a matter of excluding the problem Word file from the batch process and dealing with it by hand.
Let me know how you get on, and I’ll post any updates here.
Share via Twitter