Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Get the parent TextFrame of a marker using ExtendScript (Unstructured)

Explorer ,
Aug 02, 2022 Aug 02, 2022

Hi,

I am a newbie in ExtendScript. In my document, I have a couple of TextFrames which contain hyperText markers. Using ExtendScript I can get all the HyperText markers. Now I want to get the parent of each marker via script. But I couldn't find anything in the documentation.

Any help or suggestion would be appreciated.

Sanam  

TOPICS
Scripting
260
Translate
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 Expert , Aug 03, 2022 Aug 03, 2022

A marker will have a TextLoc property and you can use this to get the parent TextFrame. Something like this:

var textFrame;

// Assuming marker is your Marker object and doc is your Doc object.
textFrame = getTextFrame (marker.TextLoc, doc);

function getTextFrame (textLoc, doc) {

    var prop, textFrame;
	
	 // Get the text frame from the text location.
	prop = doc.GetTextPropVal (textLoc, Constants.FP_InTextFrame);
	if ((prop.propIdent.num) && (prop.propVal.obj)) {
		textFrame = prop.propVal.
...
Translate
Community Expert ,
Aug 03, 2022 Aug 03, 2022

A marker will have a TextLoc property and you can use this to get the parent TextFrame. Something like this:

var textFrame;

// Assuming marker is your Marker object and doc is your Doc object.
textFrame = getTextFrame (marker.TextLoc, doc);

function getTextFrame (textLoc, doc) {

    var prop, textFrame;
	
	 // Get the text frame from the text location.
	prop = doc.GetTextPropVal (textLoc, Constants.FP_InTextFrame);
	if ((prop.propIdent.num) && (prop.propVal.obj)) {
		textFrame = prop.propVal.obj;
		return textFrame;
	}
}
Translate
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
Explorer ,
Aug 04, 2022 Aug 04, 2022
LATEST

@frameexpert thank you for your help.

Translate
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