繁体   English   中英

将文本附加到同一单元格后,表格单元格中的 Indesign 字形消失了

[英]Indesign Glyphs in table cell disappeared after append text to the same cell

我正在为 Adob​​e Indesign 编写 js 扩展脚本。 我正面临一个问题,这很奇怪,我不知道是 Adob​​e Indesign 错误还是我的问题。

情况是:我必须在表格中插入一些特殊字符,所以我必须使用 find 和 change Glyphs 方法将这些特殊字符插入到该表格的单元格中:

month12day29.contents = "¢";
app.findChangeGlyphOptions.includeMasterPages = true;
month12day29.characters.everyItem().appliedParagraphStyle ="前ー月大丸";
month12day29.characters[0].properties={appliedFont : 'A-OTF Futo Go B101 Pro',fontStyle: 'Bold'}
app.findGlyphPreferences.appliedFont= 'A-OTF Futo Go B101 Pro';
app.findGlyphPreferences.fontStyle= 'Bold';
app.findGlyphPreferences.glyphID = 102;   //Character:  ¢
app.changeGlyphPreferences.glyphID=8103;  //Desired character, there is no unicode for this, i cant insert it directly, so i have to insert it by glyphs
app.changeGlyphPreferences.appliedFont= 'A-OTF Futo Go B101 Pro';
app.changeGlyphPreferences.fontStyle= 'Bold';
month12day29.characters[0].changeGlyph();
month12day29.characters.everyItem().appliedParagraphStyle ="前ー月大丸";   // same Font A-OTF Futo Go B101 Pro

以上部分没问题,但是当我尝试将文本附加到该单元格时,插入的字符消失了

month12day29.contents +="\r";  /// the Desired chacter above some how got deleted after this line execute

我想问一下:

  • 问题是什么?

  • 如何解决这个问题?

谢谢你,对不起我的英语不好!

由于您正在处理这种甚至没有 unicode 的奇特字形,因此可能是 JS 连接失败了。

在这种情况下,您可以将要附加到表格单元格的最后一个插入点的字符串插入。 所以你可以保留你的脚本,但作为最后一步,你可以这样做:

month12day29.insertionPoints.lastItem().contents = "\r";

这基本上让插入的字形单独存在,只是在它后面放了一些东西。

暂无
暂无

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

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