ScriptUI Centered MultiLine Text
Posted: March 5th, 2016, 3:01 am
I'm working on making a dockable script that has centered multiline text. The snippet below previews correctly from ExtendScript Toolkit, but once I run it from After Effects, the text become left justified instead of centered. Am I doing something wrong, or is this just a bug?
Code: Select all
function myScript(thisObj){
var myPanel = (thisObj instanceof Panel) ? thisObj : new Window("palette", "myScript", undefined,
{
resizeable: true,
orientation: 'column',
alignChildren: ['fill', 'top']
});
var group1 = myPanel.add('group', undefined, 'Group 1');
messageText = group1.add('statictext',[0,0,260,50], "Please select a layer\nwith keyframes",{multiline:true});
messageText.justify = "center";
var group2 = myPanel.add('group', undefined, 'Group 2');
runButton = group2.add("button", [0,0,180,25], "Run", {name:'run'} );
myPanel.layout.layout(true);
if (myPanel instanceof Window)
{
myPanel.show();
}
else
{
myPanel.layout.layout(true);
}
myPanel.layout.resize();
myPanel.onResizing = myPanel.onResize = function ()
{
this.layout.resize();
}
}
myScript(this);