Copy link to clipboard
Copied
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
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.
...
Copy link to clipboard
Copied
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;
}
}
Copy link to clipboard
Copied
@frameexpert thank you for your help.