如何在Applescript中获取Word 2011中的选定文本

如何在Applescript中获取Word 2011中的选定文本,applescript,Applescript,我想从Apple脚本中获取Word 2011活动文档中的选定文本 谢谢试试: tell application "Microsoft Word" to get selection's content 我试过这个,它很有效 tell application "Microsoft Word" activate try set selectedText to content of text object of selection

我想从Apple脚本中获取Word 2011活动文档中的选定文本

谢谢

试试:

tell application "Microsoft Word" to get selection's content

我试过这个,它很有效

    tell application "Microsoft Word"
        activate
        try
            set selectedText to content of text object of selection
            display dialog selectedText buttons {"OK"}
        on error
            display dialog "erreur" buttons {"OK"}
        end try
    end tell

但是,我在哪里可以找到内容?在哪个变量中?告诉应用程序“Microsoft Word”?设置selText以获取所选内容?结束告诉