Copy link to clipboard
Copied
I've been banging my head against a wall about this for a while and I just can't figure it out.
I have imported an XML file that includes quote tags.
The quotes are anchored to the body of the text and I have an object style applied that stylizes the frame. The image is a headshot of the person who said the quote and they're all a standard size (about 60 points tall).
The problem I'm having is that sometimes the quotes are smaller than the headshot. When that happen, the image extends past the text frame.
I'm trying to write a script that will get the height of the text frame and if it's less than 82 points, increase it to 82 points.
What I have so far is:
var myRoot = myDoc.xmlElements.item(0);
var bqs = myRoot.evaluateXPathExpression("//blockQuote");
for (var i = 0; i < bqs.length; i++) {
t = bqs.xmlContent;
try {
s = t.textContainers[0];
}
catch (e) {
break;
}
b = s.geometricBounds;
//adjust the bounds to be the right size
}
When I try to run this, it errors when I try and get the geometric bounds. Somehow, this line gives me "Invalid object for this request".
Any ideas on how I can get this to work?
Copy link to clipboard
Copied
So a co-worker pointed out that I could just set a minimum size in the auto-fit text frame option in the object style. That works for the particular job I'm working on now, but I'm still confused on why I couldn't get the geometric bounds.