How to edit path anchor points using extendscript

Community Beginner ,
Feb 04, 2022 Feb 04, 2022

Copy link to clipboard

Copied

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

TOPICS
Scripting

Views

77

Likes

Translate

Translate

Report

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 Beginner , Feb 04, 2022 Feb 04, 2022
Thanks for the help. I managed to work it out after looking at those links once again.  Thomas

Likes

Translate

Translate
Adobe Community Professional ,
Feb 04, 2022 Feb 04, 2022

Copy link to clipboard

Copied

Likes

Translate

Translate

Report

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 Beginner ,
Feb 04, 2022 Feb 04, 2022

Copy link to clipboard

Copied

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

 

Thomas012345_0-1643984551108.png

 

Likes

Translate

Translate

Report

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
Adobe Community Professional ,
Feb 04, 2022 Feb 04, 2022

Copy link to clipboard

Copied

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 )

Likes

Translate

Translate

Report

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
Adobe Community Professional ,
Feb 04, 2022 Feb 04, 2022

Copy link to clipboard

Copied

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 )

Likes

Translate

Translate

Report

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 Beginner ,
Feb 04, 2022 Feb 04, 2022

Copy link to clipboard

Copied

LATEST

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

 

Thomas

Thomas012345_0-1643992340165.png

 

Likes

Translate

Translate

Report

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