Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to change join (Mitre Join, Bevel Join or Round Join) in text using a script

Explorer ,
Jan 11, 2025 Jan 11, 2025

Hello. I can't figure out how to change the JOIN in the text (Mitre Join, Bevel Join or Round Join). For example, I will attach a simple version of how I would like to change (my main script is very large).

var doc = app.activeDocument;
var textFrame = doc.textFrames.add();
textFrame.geometricBounds = [0, 0, 100, 200];
textFrame.contents = "Hello World!";

var text = textFrame.texts[0];
text.strokeWeight = 5;
text.strokeColor = doc.colors.item(0); 
text.strokeJoinType = StrokeJoinType.MITER_END_JOIN;

// Альтернативні варіанти:
// text.strokeJoinType = StrokeJoinType.BEVEL_END_JOIN;  // Bevel Join
// text.strokeJoinType = StrokeJoinType.ROUND_END_JOIN;  // Round Join

32163471d1jh_2-1736587809385.pngexpand image

In general, the basic idea of my script is as follows: a window, a text input field, a stroke size and a drop-down list with Mitre Join, Bevel Join and Round Join. InDesign sets Mitre by default, but I need to switch between them.

 
TOPICS
EPUB , How to , Performance , Scripting , SDK , Sync and storage , UXP Scripting
131
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jan 11, 2025 Jan 11, 2025

I suppose the property is endJoin and not strokeJoinType. So the line where you are getting an error should be like the following

text.endJoin = OutlineJoin.MITER_END_JOIN
-Manan
Translate
Community Expert ,
Jan 11, 2025 Jan 11, 2025

I suppose the property is endJoin and not strokeJoinType. So the line where you are getting an error should be like the following

text.endJoin = OutlineJoin.MITER_END_JOIN
-Manan
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 11, 2025 Jan 11, 2025
LATEST
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines