简体   繁体   English

使用basil.js设置对象样式

[英]set object style with basil.js

from basil cheatsheet: 从罗勒备忘单:

b.objectStyle(”myStyle”); // return or create style with given name

But when I try it (on a text frame): 但是当我尝试(在文本框架上)时:

b.selection().appliedObjectStyle =  b.objectStyle("CAPTION");

Nothing happens. 什么都没发生。 While this works: 尽管这可行:

b.selection().appliedObjectStyle = app.documents[0].objectStyles.item("CAPTION");

So what is a good use of the 'b.objectStyle("CAPTION");' 那么'b.objectStyle(“ CAPTION”);'的好用法是什么? method apart from creating a object style? 方法除了创建对象样式?

You discovered a bug in basil.js 1.08. 您在basil.js 1.08中发现了一个错误。 This will be fixed in the next version. 这将在下一版本中修复。

Please use b.doc().objectStyles.item("CAPTION"); 请使用b.doc()。objectStyles.item(“ CAPTION”); until then. 直到那时。 That also goes for 那也适用

b.characterStyle(); b.characterStyle(); and b.paragraphStyle(); 和b.paragraphStyle(); unfortunately. 不幸。 Thanks. 谢谢。

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

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