0 Replies Latest reply on Jun 13, 2011 5:52 PM by dylw

    Fit Frame to Content

    dylw Level 1

      OK so I have a very basic script below that does a Fit Frame to Content which is designed for text frames:

       

      set myDoc to the active document

      set mySelection to the selection

      tell myDoc

           repeat with thisOne in mySelection

                fit thisOne given frame to content

           end repeat

      end tell

       

      The problem with using Fit Frame to Content on text frames is that it only works on the height, it won't adjust the width, unless it is one line of text within the text frame. I want to write the script so that it works in a similar manner to double clicking the bottom right handler of the text frame, where it fits the height and width to the longest sentence. Does anyone know of a quick easy way to do this? I was hoping to not have to calculate the length of each sentence/line break in the frame, finding the longest and changing the geometric bounds of the text frame to match.