applescript syntax for opening a document with password

R

reddust

Version: 2008
Operating System: Mac OS X 10.5 (Leopard)
Processor: Intel

Hi there. The following script opens a file using a previously defined variable file_name to describe the file and path:
open file_name

I want a script that is able to use a password to do this using a variable pass_word to store - there is no listing in the Word 2004 applescript reference
I have tried
open file_name using password pass_word
open file_name password pass_word (by analogy with the save command)

Anybody know the correct syntax?
Many thanks
reddust
 
W

William Smith [MVP]

Hi there. The following script opens a file using a previously
defined
variable file_name to describe the file and path:
open file_name

I want a script that is able to use a password to do this using a
variable pass_word to store - there is no listing in the Word 2004
applescript reference

I have tried
open file_name using password pass_word
open file_name password pass_word (by analogy with the save command)

This syntax should work for you (mind the wrapping):


tell application "Microsoft Word"
open file name "Macintosh HD:Users:testuser:Desktop:test.docx" password
document "test"
end tell


I don't know if Word 2004 used "file_name" rather than "file name" but
Apple's guidelines for populating the application's dictionary
discourages use of underscored or hyphenated words, which Microsoft had
been doing. Possibly, they corrected this in Office 2008.

Hope this helps!

--

bill

Entourage Help Page <http://entourage.mvps.org/>
Entourage Help Blog <http://blog.entourage.mvps.org/>
YouTalk <http://nine.pairlist.net/mailman/listinfo/youtalk>
Twitter: follow <http://twitter.com/meck>
 

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