correct, to use transform() you must supply a transformation matrix.
if you just need to resize the text frame with the dimensions provided try this
var title = "Dimensions of textframe"; var width = Number(Window.prompt ("width", 200, title)); var height = Number(Window.prompt ("height", 800, title)); app.activeDocument.textFrames.width = width; app.activeDocument.textFrames.height = height;
Perfect! Many thanks, Carlos!
Are you trying to resize a single line of text or an area type text box?
If you're trying to modify an "area text" box, you can simply use:
var textBox = docRef.textFrames
var inputHeight = Number(prompt("Enter Height"));
var inputWidth = Number(prompt("Enter Width"));
textBox.height = inputHeight;
textBox.width = inputWidth;
If you're trying to modify a "point type" text box, you're going to run into issues with getting the text the correct size. Due to the fact that illustrator doesn't properly measure the height of the actual text, but rather the bounding box around the text which includes an unknown and variable amount of space above, below and to each side of the text. See screenshot. Whenever you re-size a point text box, the size is measured by the bounding box, not the text itself.