Ms word Office Mac 2011:如何创建新Word文档并使用applescript保存?
我试图在Office2011上为Word编写简单的applescript,但没有成功。 我找到了这个链接,但Office 2011的语法不同,谷歌不是我的朋友。。。 我想要的:创建一个新的文档,写下日期并将新文档保存在我的主文件夹中 以下是我尝试过的:Ms word Office Mac 2011:如何创建新Word文档并使用applescript保存?,ms-word,applescript,Ms Word,Applescript,我试图在Office2011上为Word编写简单的applescript,但没有成功。 我找到了这个链接,但Office 2011的语法不同,谷歌不是我的朋友。。。 我想要的:创建一个新的文档,写下日期并将新文档保存在我的主文件夹中 以下是我尝试过的: tell application "Microsoft Word" activate make new document set theDate to current date set text of active document to th
tell application "Microsoft Word"
activate
make new document
set theDate to current date
set text of active document to theDate as text
save as active document file name "/Users/user/toto.doc"
end tell
你能帮帮我吗?这是我的山狮+MS Word 2011的作品:
set outputPath to (path to home folder as string) & "toto.doc"
tell application "Microsoft Word"
activate
make new document
set theDate to ((current date) as string)
tell active document
set theRange to create range start 0 end 0
set content of theRange to theDate
end tell
set activeDoc to active document
save as activeDoc file name outputPath
end tell
希望这有帮助 不幸的是,在SnowLeo上使用您的脚本时,我遇到了一个与另存为相关的错误:“Erreur dans Microsoft Word:active document ne comprend pas le message Save as.”活动文档中的编号-1708谢谢Tchap!好的,我明白了:路径格式必须像“Users:myuser:TestFolder:”是的!但是你最好使用编程的
主文件夹路径
表达式,而不是硬编码的表达式,这始终是一种更好的做法,我相信它是可以替代的。有一种听起来像真实句子的编程语言真是太奇怪了。