Skip to main content
Known Participant
February 12, 2024
Answered

how to get all joint point value in textframe area text using extendscript?

  • February 12, 2024
  • 1 reply
  • 509 views

Hi ,

 

I need to get all join point value in custom area text (textframe) using extendscript?.

 

i try this,

app.activeDocument.selection[0].geometricBounds;

it returns

69.1558441558445,-109.363636363636,586.038961038961,-426.246753246753

 

Please help.

This topic has been closed for replies.
Correct answer RobOctopus

Area text frames have a textPath associated with them. this textpath is what holds the information for where the anchor points are. To get to it via extendscript you can do as follows

var thisFrame = app.activeDocument.textFrames[0]
alert(thisFrame.textPath.pathPoints.length)
/* just checking how many path points come up */
for(var p=0;p<thisFrame.textPath.pathPoints.length;p++){
    var thisPoint = thisFrame.textPath.pathPoints[p]
    /* here we get the reference to the pathpoint and can do what we want. simple alert for what the anchor value is */
    alert(thisPoint.anchor)
}

1 reply

RobOctopus
RobOctopusCorrect answer
Inspiring
February 12, 2024

Area text frames have a textPath associated with them. this textpath is what holds the information for where the anchor points are. To get to it via extendscript you can do as follows

var thisFrame = app.activeDocument.textFrames[0]
alert(thisFrame.textPath.pathPoints.length)
/* just checking how many path points come up */
for(var p=0;p<thisFrame.textPath.pathPoints.length;p++){
    var thisPoint = thisFrame.textPath.pathPoints[p]
    /* here we get the reference to the pathpoint and can do what we want. simple alert for what the anchor value is */
    alert(thisPoint.anchor)
}
Known Participant
February 12, 2024

Hi RobOctopus,

 

Thanks for your reply, it returns only 4 points not for all.

 

529.357142848246,-561.500000000002
463.303571424123,-626.107142857143
397.25,-561.500000000002
463.303571424123,-496.892857142859

 

I attached my ai file here for your reference.