Ms word 使用Applescript复制单词表

Ms word 使用Applescript复制单词表,ms-word,applescript,osx-snow-leopard,Ms Word,Applescript,Osx Snow Leopard,我在Word 2011中将数据写入一个表,我可以获得该表的属性,但如何复制该表并向活动文档添加一个新表,但使用不同的名称/ID?abFile在tell块之前指定 tell application "Microsoft Word" activate open abFile set tableProps to get properties of tables of active document end tell 我想说的是: make new table in active document w

我在Word 2011中将数据写入一个表,我可以获得该表的属性,但如何复制该表并向活动文档添加一个新表,但使用不同的名称/ID?abFile在tell块之前指定

tell application "Microsoft Word"
activate
open abFile
set tableProps to get properties of tables of active document
end tell
我想说的是:

make new table in active document with tableProps and name "2"

我尝试的第一件事是:

tell application "Microsoft Word"
    activate
    open abFile
    set tableList to tables of active document
    set firstTable to item 1 of tableList
    make new table in active document with properties (properties of firstTable)
end tell
这确实会创建一个新表,但没有一个属性被实际复制-至少行数和列数不同

您可以尝试的另一件事是复制一个表:

tell application "Microsoft Word"
    activate
    open abFile
    set tableList to tables of active document
    set firstTable to item 1 of tableList
    duplicate item 1 of tableList
end tell

同样,这会创建一个新表,但其单元格内容与原始表相同。我不确定您是只想复制属性,还是想同时复制单元格内容。

从字典中可以看出,MS Word表没有“name”属性。至少OSX 10.8.5上的Word 2011没有。另外,我认为对于任何正确实现的applescript字典,对象ID总是由applescript运行时环境分配的,并且是只读的。查看SL中的Word 2011字典我同意,但是我如何才能创建一个具有相同属性的新表,并让AS来处理ID?