【问题标题】:How to flip type on a path in InDesign using ExtendScript?如何使用 ExtendScript 在 InDesign 中的路径上翻转文字?
【发布时间】:2023-02-12 20:07:42
【问题描述】:
我尝试在路径上创建文字,然后使用 ExtendScript 在 InDesign 中的路径上翻转文字:
var myDocument = app.documents.add();
myDocument.documentPreferences.pageWidth = 120;
myDocument.documentPreferences.pageHeight = 120;
var myOval = myDocument.ovals.add();
myOval.absoluteRotationAngle = 180;
myOval.geometricBounds = [2.5, 2.5, 117.5, 117.5];
myOval.strokeWeight = 0;
var myTextPath = myOval.textPaths.add();
myTextPath.flipPathEffect = FlipValues.FLIPPED;
myTextPath.parentStory.appliedFont = "Arial\tRegular";
myTextPath.parentStory.pointSize = 10;
myTextPath.parentStory.leading = 12;
myTextPath.parentStory.justification = Justification.CENTER_ALIGN;
myTextPath.contents = "text in a circle";
InDesign 中不显示类型。
如何使用 ExtendScript 在 InDesign 中的路径上翻转文字?
我感谢你的帮助。
【问题讨论】:
标签:
javascript
adobe-indesign
extendscript
【解决方案1】:
目前尚不清楚您想要的结果到底应该是什么样子。所以可以有不同的解决方案。例如,您可以“打开”椭圆形(使其成为开放路径):
var myDocument = app.documents.add();
myDocument.documentPreferences.pageWidth = 120;
myDocument.documentPreferences.pageHeight = 120;
var myOval = myDocument.ovals.add();
myOval.absoluteRotationAngle = 180;
myOval.geometricBounds = [2.5, 2.5, 117.5, 117.5];
myOval.strokeWeight = 0;
// make an extra point on the path
var p = myOval.paths[0].pathPoints[0];
myOval.paths[0].pathPoints.add(p.properties);
// make the path an open path
myOval.paths[0].pathType = PathType.OPEN_PATH;
var myTextPath = myOval.textPaths.add();
myTextPath.flipPathEffect = FlipValues.FLIPPED;
myTextPath.parentStory.appliedFont = "Arial Regular";
myTextPath.parentStory.pointSize = 10;
myTextPath.parentStory.leading = 12;
myTextPath.parentStory.justification = Justification.CENTER_ALIGN;
myTextPath.contents = "text in a circle";
输出: