...I can't detect the second item with script, because it isn't a real item...
Can you select the second item in InDesign?
Can you see an anchor point for this object anywhere in fextFrame?
Anchored items are as much real as standalone ones. There is only a different way to refer to them.
Determine if this arrow is an anchored object in fact.
Starting from attached doc view (textFrame selected) your arrow geoBounds supposed to be:
...if arrow is anchored there indeed.
That seems to work.
Ok so I must check on each items of my group if there is a spline item. Then I have to get all geometrics bounds to get the size of the full group. After that, I could get the real size of my exported image.
There isn't any easier way ?
I'll post my function to get the full size for other people who are interested.
Thanks for your answer Jarek
Sigh. The case is much more complicated.
Consider drop shadows, tables that exceed the bounds of text frames, etc.etc.
But you could export the whole group as image, place that same image at 100% scale and measure after placing.
Still, with that method there will be unnecessary "white space" or transparent pixels in your exported image. To get the net size of all writing pixels you have to use cross scripting with e.g. PhotoShop.