简体   繁体   English

InDesign:更改默认单元格样式

[英]InDesign: Changing default Cell Style

I am trying to change the default document settings for a batch of InDesign documents – that is, the styles, swatches etc. that are 'active' (marked blue) in an open document with nothing selected. 我试图更改一批InDesign文档的默认文档设置-即在未选择任何内容的情况下在打开的文档中处于“活动”状态(标记为蓝色)的样式,色板等。

But I have a hard time figuring out how to change the default cell style. 但是我很难弄清楚如何更改默认的单元格样式。

Stroke swatch, Paragraph style and Character style are simple: 笔画,段落样式和字符样式都很简单:

app.activeDocument.pageItemDefaults.strokeColor = "Black";

app.activeDocument.textDefaults.appliedParagraphStyle = app.activeDocument.paragraphStyles.item ("[Basic Paragraph]");

app.activeDocument.textDefaults.appliedCharacterStyle = app.activeDocument.characterStyles.item ("[None]");

Cell style, however, is not so easily accessed, even though it is really just a simple mouse-click for a user. 但是,即使对用户而言,只需简单地单击鼠标即可轻松地访问单元格样式。 There is no 'appliedCellStyle' property. 没有'appliedCellStyle'属性。

How can I do this? 我怎样才能做到这一点?

I think defalut cell style is "None", though selected other cell style in GUI if you want apply default cell style as "None", there are no need to do. 我认为默认单元格样式为“无”,但是如果要在默认单元格样式中将其设置为“无”,则在GUI中选择了其他单元格样式,则无需这样做。 when create a table without applying table style, the cells are always applyied 'None'. 在不应用表格样式的情况下创建表格时,单元格始终被应用为“无”。

please try this code. 请尝试此代码。

var table = app.activeDocument.textFrames.add().tables.add();
alert(table.cells.firstItem().appliedCellStyle.name);

thank you mg 谢谢你毫克

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

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