applescript字搜索修订

时间:2013-11-04 21:26:21

标签: ms-word applescript revision

我正在尝试组织Word文档中的修订。我显然缺少一些非常基本的东西,因为我无法走得太远。

以下脚本

tell application "Microsoft Word"

    set activeDoc to active document

    set revCount to count of revisions of activeDoc

    set aRev to first item of revisions of activeDoc

    set auth to author of aRev
    set when to date value of aRev

end tell

生成以下内容:

tell application "Microsoft Word"
    get active document
        --> active document
    count every revision of active document
        --> 1275
    get item 1 of every revision of active document
        --> current application
Result:
error "The variable aRev is not defined." number -2753 from "aRev"

“set auth”引用发生错误。我已经尝试了列表中的各种项目,结果相同。我还从字典中注意到文本范围可以包含修订版,但即使是跨越整个文档的范围,我也会从修订版的计数中得到零。

1 个答案:

答案 0 :(得分:0)

以下任何一项都应解决当前问题:

set aRev to first revision of activeDoc

set theRevs to the revisions of activeDoc
set aRev to the first item of theRevs

(我认为以下内容应该有效,但是现在我已经忘记了为什么不这样做了)

set aRev to the first item of (revisions of activeDoc)