我想只要打開使用AppleScript在Microsoft Word文檔,這裏是我的腳本:AppleScript的MSoft打開Word文檔
tell application "Microsoft Word"
open document "Macintosh HD:test.docx"
end tell
但它總是告訴我,我試圖訪問不存在的對象。但文件在那裏...!
請幫忙,謝謝。
我想只要打開使用AppleScript在Microsoft Word文檔,這裏是我的腳本:AppleScript的MSoft打開Word文檔
tell application "Microsoft Word"
open document "Macintosh HD:test.docx"
end tell
但它總是告訴我,我試圖訪問不存在的對象。但文件在那裏...!
請幫忙,謝謝。
文件指的是打開的文件在AppleScript的
所以你想做的事就是打開文件
tell application "Microsoft Word"
open file "Macintosh HD:test.docx"
end tell
自從我使用AppleScript以來已經有幾千年了,但是您不應該將HD文件夾中的文件稱爲":Macintosh HS:test.docx"
(請注意引號冒號)嗎?
根據this,我剛剛測試過,你不需要的文件,也沒有Macintosh硬盤,但包括激活
所以,這將是:
tell application "Microsoft Word"
activate
open "test.docx"
end tell
出現錯誤,說test.docx不理解打開的消息。也許由於輸入 – user635064 2011-05-09 23:38:25
,因爲MSWord是如此特別,您可能需要打開文檔..現在,如果您的默認應用程序爲docx是MSWord(它應該),您可以使用Finder來做「開放」,讓它處理與MSWord的談話 – 2011-05-09 23:44:24
號釷爲輸入儘管。 – user635064 2011-05-09 23:39:03