Skip to main content
Participant
Apr 3, 2025 1:55 PM UTC
Answered

Using Javascript to add text to a circular path

I've tried arguing with chatGPT about this to no avail.  Does anyone know if it is possible to add text to an elliptical path in a Javascript function?

jduncan
jduncanCorrect answer
Community Expert
Apr 3, 2025 3:19 PM UTC

Try this out.

var doc = app.activeDocument;
var ellipse = doc.pathItems.ellipse(0, 0, 360, 360);
var textFrame = doc.textFrames.pathText(ellipse);
textFrame.contents = "This is text on a path!";

 

3 replies

jduncan
Community Expert
jduncanCommunity ExpertCorrect answer
Community Expert
Apr 3, 2025 3:19 PM UTC

Try this out.

var doc = app.activeDocument;
var ellipse = doc.pathItems.ellipse(0, 0, 360, 360);
var textFrame = doc.textFrames.pathText(ellipse);
textFrame.contents = "This is text on a path!";

 

Translate
PercypawsAuthor
Participant
Apr 3, 2025 3:24 PM UTC

Way better that the  bots!!!

Seems to work, and I can hone it for my Nightingale chart!!

Cheers muchly.

 

Translate
jduncan
Community Expert
Community Expert
Apr 3, 2025 6:01 PM UTC

Great to hear. Can you please mark the answer as correct when you get a chance? Let us know if you need any more help.

Translate