This script makes the 1st text frame in the active document to grow vertically: from top to bottom.
var myDoc = app.activeDocument;
var myTF = myDoc.textFrames;
var myViewPr = myDoc.viewPreferences;
var myHM = myViewPr.horizontalMeasurementUnits;
var myVM = myViewPr.verticalMeasurementUnits;
myViewPr.horizontalMeasurementUnits = MeasurementUnits.millimeters;
myViewPr.verticalMeasurementUnits = MeasurementUnits.millimeters;
var myBounds = myTF.geometricBounds;
myBounds += 1;
myTF.geometricBounds = myBounds;
myViewPr.horizontalMeasurementUnits = myHM;
myViewPr.verticalMeasurementUnits = myVM;
Changing myBounds+= ; to myBounds+= 1; makes it grow horizontally from left to right.
BTW, unlike fit() method, this approach works for multicolumn text frames.
This is the method I used wanted to know if there was something like Autogrow cell
Cell has autoGrow property — bool, r/w.
If true, the height of the cell or the cells in the Cell can increase or decrease automatically to fit cell content. Note: Allows cells to grow or shrink to the maximum or minimum height, if specified.
InDesign does not have the functionality of auto-expanding text frames. So, no, there is no autoGrow property for text frames.
If it's very important to you, you can try AuotFlow Pro: http://in-tools.com/autoflowpro.html
Would you mind letting us know if one of the suggestions here helped?
In practice I have sharpened a little ingenuity is not perfect but it helps a lot according to a table for adobe post script you can calculate the height of a pt in mm according to the formula 1 pt = 25.4/72, and from this formula is unable to approximate the height of TextFrame depending on its contenuto.Naturaly the end must always check whether the text frame is overflow and maximize, but if it happens rarely.
You can get a similar effect by setting:
myTextFrame.textFramePreference.autoSizingType = AutoSizingTypeEnum.HEIGHT_ONLY;
FWIW: Note that this thread started in 2010.
InDesign CS6 was released in 2012 and was the first version that included property autoSizingType .
Never too late to add an happy end to a thread!
The question is still relevant and still comes up in searches so it makes sense to make the search results useful. Hopefully in the future there will be a real solution