Home » Questions » Computers [ Ask a new question ]

Mac OS X diff tool for Microsoft Word docs?

Mac OS X diff tool for Microsoft Word docs?

I am using svn for version control and want to be able to compare 2 revisions of a MS Word doc side-by-side. I am aware of Araxis Merge but this converts the doc to text and compares which is more clever than I need it to be. I would like a tool that would allow me to visually compare the files preserving the formatting, images, etc. that may be present in the doc.

Asked by: Guest | Views: 473
Total answers/comments: 1
Guest [Entry]

"I wrote a tool in applescript for using MS Word for diffing word files:

on run (arguments)
set old to first item of arguments as string
set new to second item of arguments as string
tell application ""Microsoft Word""
activate
open old
compare active document path new as text
end tell
end run

This can be run as following osascript <path to script> old.docx new.docx, or added as difftool in your .gitconfig osascript <path to script> $LOCAL $REMOTE. I use it together with Sourcetree. The only problem is having to grant access to all of the three temporary files

I expanded the script to send the files to the appropriate tool based on filetype. At the moment, I use Word for .docx and kdiff3 for other files, and this could be expanded to other tools as well.

on run (arguments)
set a to first item of arguments as string
set b to second item of arguments as string
if {a ends with "".docx"" or a ends with "".doc""} then
diff({a, b})
else
do shell script ""/usr/local/bin/kdiff3 "" & a & "" "" & b
end if
end run

on diff(arguments)
set old to first item of arguments as string
set new to second item of arguments as string
tell application ""Microsoft Word""
activate
open old
compare active document path new as text
end tell
end diff

I know I might be 10 years late, but was struggling to find a solution, so hopefully this will be helpfull to someone."