Share via

Applescript - Can it open a document?

Anonymous
2016-02-03T22:12:44+00:00

This is a very basic question. It concerns Applescript working with MS Word.

Can an Applescript open a Word document? If so, what are the command lines which must be used in the script. I realize this is a pretty fundamental question, but I can find no help in the Applescript Help.

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2016-02-04T16:51:10+00:00

Word would work the same as any other app. You can use something like:

tell application "Finder"

open document "/Users/<you>/Desktop/myfile.docx" as POSIX file

end tell

You'll need to use the proper path to the file of course, but it's a simple matter of asking the Finder to open the file as you would yourself through a double-click.

I like the POSIX path because you can simply drag and drop the file in the Script editor to get the path in.

Corentin

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

Answer accepted by question author

Anonymous
2016-02-04T02:23:33+00:00

Try one of these pages.

Was this answer helpful?

0 comments No comments

0 additional answers

Sort by: Most helpful