This content has been marked as final. Show 8 replies
>Is there a problem in CS3 when using GeometricBounds for frames in frames?
Generally not. And the JS equivalent of your code works fine. Maybe it's a VB thing.
If adding the text frame as an inline pushed it into overset text, you'd get that error message.
thank you for confirm. I will change my VB code, if there is no workaround.
It's just the way things work. And overset inline/anchored frame doesn't have geometry, so it doesn't have geometricBounds -- this is a change in CS3; previously, you'd get meaningless values, but that at least would allow you to work with the width and height.
>And overset inline/anchored frame doesn't have geometry, so it doesn't have geometricBounds
Is there a way to query if an object is within the overset?
With this exception thrown I can't even test if it's overset or not.
if(textframe.geometricBounds==null) ... [crashes if textframe is in overset]
If the parentTextFrames property of the parent of the anchored object is an array of length zero, then the object is in overset text.
thanks for your quick reply.
I still have some problems with this. I created a scenario where a textframe holds some text plus another textframe.
Something like this
>// create outer textframe
var outerTF = app.documents.textFrames.add();
outerTF.geometricBounds = [30, 30, 100, 100];
outerTF.texts.contents = "Hello World!";
// create inner textframe
var innerTF = outerTF.characters[-1].textFrames.add();
innerTF.geometricBounds = [30, 70, 70, 90];
innerTF.texts.contents = "I am the inner Textbox";
// resize outer textframe so that the inner one becomes overset
outerTF.geometricBounds = [30, 30, 60, 60];
alert(innerTF.parent); // works fine
After that I tried to address the inner textframe in another script. When accessing the textframe via the textframes property of the textframe I even get exceptions when calling to textframe.parent. But when I access using the pageItems, it works fine.
I quite don't understand the reasons for that...
>// the following two lines of code work only if the inner textframe is not in overset - if it is in overset the expression "innerOne.parent" throws an exception
var innerOne = app.documents.textFrames.textFrames;
alert(innerOne.parent); // crashes
>// these following lines work fine whether or not it is in overset
var myinnertf = app.documents.textFrames.allPageItems;
alert(myinnertf.parent); // works fine
[edit: beware of the formatting; some parts are in the comments; dont't know how to insert explicit newline-chars]
If the internal text frame is in overset then it is not in the text frame, it's in the parent story of the text frame.
The allPageItems property might be an interesting exception here. For example, in the UI, if you cut that last frame of the overset story and paste it somewhere else, then the overset content comes along for the ride, so it looks as though in this case allPageItems is picking up the overset page items where the pageItems property wouldn't.
Interesting difference of which I was not aware, but I can see how it makes sense.