ScriptUI Multiline StaticText Frame Too Large
Hi Folks,
Has anyone here had an issue (and, hopefully come up with a workaround!) where multiline static text frames that are defined with a non-default width become taller than they should be? This seems to happen in all versions of InDesign. FWIW, this problem does not seem happen in Illustrator (using the same code).
The longer the static text, the more unnecessary white space appears at the bottom of the text frame--and the taller the window becomes. To me, it seems like the height of the frame is being calculated for a narrower frame width than what the script defines.
Here's sample code that displays a dialog box that shows the issue. (NOTE: The size of the static text's frame is filled with red to show what's happening). I would expect that the red area would stop at (or very near) the bottom of the static text.
var MsgBoxTest = new Window('dialog',undefined,undefined);
buildWindow();
MsgBoxTest.show();
function buildWindow(){
MsgBoxTest.alignChildren = ['left','top'];
MsgBoxTest.orientation = "column";
// Properties for MsgBoxTest.MsgGroup
MsgBoxTest.MsgGroup = MsgBoxTest.add('group',undefined);
MsgBoxTest.MsgGroup.alignment = ['left','top'];
MsgBoxTest.MsgGroup.maximumSize= [650,600];
MsgBoxTest.MsgGroup.alignChildren = [' ','top'];
MsgBoxTest.MsgGroup.orientation = "column";
MsgBoxTest.MsgGroup.graphics.backgroundColor = MsgBoxTest.MsgGroup.graphics.newBrush(MsgBoxTest.MsgGroup.graphics.BrushType.SOLID_COLOR,[1,0,0],1);
// Properties for MsgBoxTest.MsgGroup.StaticText1
MsgBoxTest.MsgGroup.StaticText1 = MsgBoxTest.MsgGroup.add('statictext',undefined,"Nonserita demquat issimus ex eatiust, occatur, ut ommod expliquodi ratusam, que vendest dolorepro coreium volorempere doluptat as exceaquam quo qui\r\rBus reped mos exere od quodior porum?", {multiline:true});
MsgBoxTest.MsgGroup.StaticText1.alignment = ['left','top'];
MsgBoxTest.MsgGroup.StaticText1.maximumSize= [325,600];
MsgBoxTest.MsgGroup.StaticText1.preferredSize.width = 325;
MsgBoxTest.MsgGroup.StaticText1.preferredSize.height = -1;
}
Are there any workarounds for this issue?
TIA!!!
-- Jim