Quantcast
Channel: Adobe Community: Message List - InDesign Scripting
Viewing all articles
Browse latest Browse all 37788

Re: find and remove text frames with same geometricBounds

$
0
0

ok Bala ...due to decimal differences some frames weren't removed.

I solved with "Math.round" in place of "Number"

 

===================

 

var mySelection = app.activeDocument.selection[0].geometricBounds;

var myWidth = Math.round(mySelection[3]-mySelection[1]);

var myHeight = Math.round(mySelection[2]-mySelection[0]); alert(myHeight);

var allFrames = app.activeDocument.allPageItems;

while(t = allFrames.pop() ) {

    if(t.isValid){                    

        var myTextframe = t.geometricBounds;

        var myTWidth = Math.round(myTextframe[3]-myTextframe[1]);

        var myTHeight = Math.round(myTextframe[2]-myTextframe[0]);      

        if((myWidth == myTWidth) && (myHeight == myTHeight)){              

            t.remove();

            }

        }

    }

 

===================

 

Now your script works fine!

 

Thanks a lot!


Viewing all articles
Browse latest Browse all 37788

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>