Skip to main content
Participant
February 4, 2022
Answered

How to edit path anchor points using extendscript

  • February 4, 2022
  • 3 replies
  • 604 views

I have a document (and page) that contains a path. I want to be able to adjust the anchor points for the path in many drawings quickly. How can I access the path property within extendscript?

 

Many thanks in advance

Thomas

This topic has been closed for replies.
Correct answer Thomas012345

Thanks for the help. I managed to work it out after looking at those links once again. 

 

Thomas

 

3 replies

Community Expert
February 4, 2022

Hi Thomas,

your variable textFrame holds a text frame of unknown shape to me. This text frame has a paths property.

Note the plural here. Could be a compound path with a lot of paths and every path has path points.

Or all the path points of one path are described as an array of arrays in property entirePath.

Read into the links I gave you to understand the structure. Also see into DOM documentation.

 

To get the first path point of the first path of your text frame:

 

textFrame.paths[0].pathPoints[0]

 

 

Regards,
Uwe Laubender

( ACP )

Thomas012345AuthorCorrect answer
Participant
February 4, 2022

Thanks for the help. I managed to work it out after looking at those links once again. 

 

Thomas

 

Community Expert
February 4, 2022

Also search Marc Autret's website for pathPoint.

You'll find something like that:

 

InDesign Scripting Forum Roundup #11
Marc Autret, September 16, 2017
Converting a “Quasi Rectangle” into a Rectangle

https://www.indiscripts.com/post/2017/09/indesign-scripting-forum-roundup-11#hd2sb1

 

That may lead you to discussions in the forum that we had here:

https://community.adobe.com/t5/indesign-discussions/js-paths-rentagles/td-p/9162704#9648722

 

Regards,
Uwe Laubender

( ACP )

Community Expert
February 4, 2022
Participant
February 4, 2022

Hi Uwe, 

 

Thanks for your reply, so it might be easier if I share the code that I've got so far. Maybe you can point out where I'm going wrong... I'm trying to get to the path property that I need so that I can make changes to it. 

 

Thanks

Thomas