Tuesday, December 12, 2017

#1 2017-12-01 01:08:28 pm

pruppert
Member
Registered: 2012-07-24
Posts: 18

Help with "Grant File Access" problem in Microsoft Word

I am trying to use AppleScript to sequentially open Microsoft Word documents in a folder to perform actions on them. However, I am getting an error related to access privileges whenever the script tries to open each file. Specifically, I get this:

Screen%20Shot%202017-12-01%20at%2011.46.18%20AM.png

I have searched these forums and google for how to circumvent this, but have not had success with any of the existing suggestions. I am hoping someone here can set me in the right direction.

Thank you.

macOS: 10.13.1
Microsoft Word 2016: 15.40

Applescript:


tell application "Finder"
   set fl to files of folder POSIX file "/Users/username/Desktop/Test Data Summaries" as alias list
end tell

repeat with f in fl
   set theFile to f as alias
   tell application "Microsoft Word"
       activate
       delay 1
       open theFile password document "password"
       delay 5
       close active document
   end tell
end repeat

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)