Mac OS X diff tool for Microsoft Word docs?

5,318

Solution 1

I asked another question on diffing (comparing) files a while back. You might pick some recommendations of from here:

https://stackoverflow.com/questions/1075708/diff-utility-works-for-2-files-how-to-compare-more-than-2-files-at-a-time

Wikipedia always helps as well:

http://en.wikipedia.org/wiki/Comparison_of_file_comparison_tools

For regular work though i usually end up using vimdiff (and there is a vim for mac). All you do to vimdiff (up to 4 default) files is vim -d file1 file2 file3 or gvim -d file1 file2 file3

Solution 2

just svn export the older file elsewhere and then use the M$ Compare Changes tool.

Solution 3

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.

Share:
5,318

Related videos on Youtube

slhck
Author by

slhck

Updated on September 17, 2022

Comments

  • slhck
    slhck over 1 year

    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.

    I know MS Word has a compare docs feature using track changes but this requires 2 copies of the document to be present on your drive. I want to directly compare revisions in the svn repository db without having to revert my local copy, change the filename and then compare to another working copy.

    Is there any tool (free or commercial) that can do this?