Copy link to clipboard
Copied
I require finding the location of the text frame and text path element in a spread. I can do that easily for text frame by looking at path point array of the text frame. However, I am not able to do the same for text path element. Please guide me how can I find the location of text path.
Copy link to clipboard
Copied
Hi,
I assume, this is a scripting question. You mentioned the "path point array".
The parent of a textPath can be:
graphicLine, oval, polygon, rectangle, textFrame and EPSText.
If you located a textPath object, maybe through looping the textContainer array of a story, ask for its parent and then check the parent's pathPoints array if you are interested in path points.
However, the exact path that the text is flowing is not available.
Mainly that depends on the applied text path effects and the formatting of the text.
Regards,
Uwe
Copy link to clipboard
Copied
Some clarifications on textPath and textContainer with ExtendScript:
Assumed some text is selected on a text path:
var selectedText = app.selection[0];
And assumed you'll start from the parentStory of that selected text.
That story could flow through several text containers, text frames and text paths alike.
You'll get all the text containers of a story written to an array with e.g.:
var textContainersOfStoryArray = selectedText.parentStory.textContainers;
If you now loop the text containers array, the parent of the text container will always be the story:
Sorry. I was wrong on this.
The parent of a textContainer that holds a text frame will be the parent of that text frame, maybe a spread.
The parent of a textContainer that holds a textPath is the object that forms the path: A polygon maybe.
for(var n=0; n<textContainersOfStoryArray.length;n++)
{
$.writeln(n+"\t"+textContainersOfStoryArray
.parent); }
[ EDITED: Remove contents ]
Hope, that helps.
Regards,
Uwe
Copy link to clipboard
Copied
Hi Uwe,
Thank you for taking time answering the question. So if I'm not wrong the path point array of the text path container like a polygon in my case will refer to the location of the text path. As it is contained within the polygon. Sorry if it sounds stupid as I'm relatively new to IDML.
Copy link to clipboard
Copied
Hi,
if it's more about the structure of an IDML I'd position one single text path on a polygon with significant text (that is easily searchable later in the IDML package) on an InDesign document page, save that to IDML and inspect the IDML. From that example it should be clear how the relationship of the polygon to the text path is made.
And then I would do another text frame and thread that to the text path. And another text frame that is threaded to the polygon and also inspect the IDML. You have to inspect the Story XML for the text contents and its formatting and the Spread XML for the polygon's and text frames path points.
I hope you are not new to InDesign and hopefully not new to ExtendScript, because the property/value pairs listed in the DOM can give you valuable hints for searching the IDML.
Note: Not all property/value pairs of an object in IDML are available in the document object model for scripting.
Good luck with that,
Uwe
Copy link to clipboard
Copied
...I can do that easily for text frame by looking at path point array of the text frame...
This is not a scripting question, I am afraid.
Jarek
Copy link to clipboard
Copied
Hi Jarek,
hm. Now, that I read the tags—idml, XML and InDesign CS4—you could be right.
But where to move that thread then? Back to the Adobe InDesign user-to-user forum?
Regards,
Uwe
Copy link to clipboard
Copied
Hi Jarek,
Yes, it is not exactly the scripting question, it is more like a generalised question about document structure of IDML. Sorry if I've tagged it wrong.