Word を終了せずにドキュメントを閉じようとしているだけですが、うまくいきません。
私はもう試した :
close documents saving no
close active document
close document 1
しかし、これはどれも機能していません..
私が得るエラー(クローズラインで)は次のとおりです。
Microsoft Word got an error: The object you are trying to access does not exist
これは単純化されたスクリプトです。誰にもアイデアはありますか?オンラインのすべての例はこの構文を使用しているようですが、Mac Office 2011 バージョンで何かが変更されたかどうかわかりませんか?
set input to {POSIX path of "/Users/Wesley/Desktop/test.doc"}
--ENABLE GUI SCRIPTING
tell application "System Events"
if UI elements enabled is false then set UI elements enabled to true
end tell
--RUN THE GUISCRIPT
set pdfSavePath to POSIX path of (choose folder with prompt "Set destination folder")
repeat with x in input
display dialog x
tell application "Microsoft Word"
activate
open x
set theActiveDoc to the active document
close theActiveDoc saving no
return
end tell
end repeat