Quantcast
Channel: Adobe Community : Popular Discussions - InDesign Scripting
Viewing all articles
Browse latest Browse all 15932

Tables inside overset text frames

$
0
0

Hi everybody!

 

Im trying to write a script to set the width of all tables in a document equal to its parent text frame, I was succesful, but

the tables that are overflowed do not get resized. I have only come up with a way to find if there is an overflowed text frame

but not to find and overflowed text frame contents. PLS HELP!

 

heres my code:

 

//resizes tables

 

var myTextFrames = app.activeDocument.textFrames.everyItem();

var myTables = myTextFrames.tables.everyItem().getElements();

for (var i = 0; i < myTables.length; i++){

         var myTextFrame =  myTables[i].parent;

                    var myWidth = myTextFrame.visibleBounds[3] - myTextFrame.visibleBounds[1];

            myTables[i].width = myWidth;

         };

 

//finds a textframe with overset text

 

var myOverset = app.activeDocument.textFrames.everyItem().getElements();

                for(var x = 0; x < myOverset.length; x++){

                    if(myOverset[x].overflows == true){   

                    alert("There is overset text")

                    }

                };


Viewing all articles
Browse latest Browse all 15932

Trending Articles



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