我正在尝试为Office 2011上的Word编写简单的applescript,但没有成功。我找到了这个链接,但是Office 2011的语法是不同的,谷歌在这个任务上不是我的朋友……http://www.mactech.com/articles/mactech/Vol.23/23.01/2301applescript/index.html
我想要的:创建一个新文档,写下日期,并将新文档保存在我的主文件夹中
这是我尝试过的:
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你能帮我个忙吗?
发布于 2012-12-26 21:52:12
这适用于我的Mountain Lion + 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希望这能有所帮助!
https://stackoverflow.com/questions/14040096
复制相似问题