Applescript + InDesignselect表格中的正文行

我目前正在尝试自动化一些数据格式。 源数据在Excel中格式化。 inDesign模板已经格式化。 我可以右键单击表格并select正文行,然后粘贴数据,它看起来很漂亮。 我正在寻找删除这一步,但我无法弄清楚如何获得applescriptselectinDesign模板的表和正文行。 以下两种似乎都不起作用。

set selection to body rows of table 1 of active document 
 select body rows of table 1 of active document 

任何帮助,这将是伟大的。

不幸的是, select命令只能用于单个行,而不是所选表中的所有行。

从本质上讲,你必须去排行,并决定row type 。 一旦你决定这行是一个body row ,你可以select它。

将所选行添加到另一个选定行的语法非常棘手,特别是没有示例。 请参阅下面的完整脚本。

  tell application "Adobe InDesign CC 2015" set allBodyRows to every row of every table of every story of active document whose row type is body row set bodyRow to {} repeat with i from 1 to (count allBodyRows) set bodyRow to item i of allBodyRows if i = 1 then select bodyRow else select bodyRow existing selection add to end if end repeat end tell 

我认为你需要以不同的方式引用你的表格。 尝试这个:

  set allTables to every table of every story of active document set myTable to item 1 of allTables 

那么你应该可以select行:

 tell table myTable select first row end tell