Compare documents with AppleScript

T

Thomas_Röfer

Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel I am trying to compare two documents with a script that calls Word's compare command:

set doc1 to choose file with prompt "Please select a Word document file:"
set doc2 to choose file with prompt "Please select a Word document file:"
tell application "Microsoft Word"
        open doc1
        compare active document path doc2
end tell

It seems that the command "compare" is not understood. The same is true for the command "merge". However, according to the documentation, they should exist.

What is wrong?
 
P

Peter Jamieson

Try

set doc1 to choose file with prompt "Please select a Word document file:"
set doc2 to choose file with prompt "Please select a Word document file:"
tell application "Microsoft Word"
open doc1
compare active document path doc2 as text
end tell

(doc1 and doc2 will either be alias or file objects - I am not sure.
Sometimes commands are OK with the object, but sometimes they want a string)

Peter Jamieson

http://tips.pjmsn.me.uk
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top