简体   繁体   English

将段落样式应用于 InDesign 脚本中当前表格的最后一个单元格

[英]applying the paragraph style to last cell of current table in InDesign script

How can I applying the paragraph style to last cell of current table in InDesign script.如何将段落样式应用于 InDesign 脚本中当前表格的最后一个单元格。

var doc = app.activeDocument,
table = doc.stories[1].tables[0];
var rc= table.rows.count;
table.rows[rc-1].cells[2].text.applyedParagraphStyle="t1";

Texts is a collection of text items in the cell. Texts 是单元格中文本项的集合。 You can apply paragraph style to collection or you need to reference an item in the collection您可以将段落样式应用于集合,或者您需要引用集合中的项目

Try this:尝试这个:

table.rows[rc-1].cells[2].texts.applyedParagraphStyle="t1";

or this:或这个:

table.rows[rc-1].cells[2].text[0].appliedParagraphStyle="t1";

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM