Expressions/Scripts/Presets

Moderator: Paul Tuersley

 
jordanwade33
Topic Author
Posts: 13
Joined: Mon Dec 08, 2014 11:11 pm

ScriptUI Centered MultiLine Text

Sat Mar 05, 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?

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);

Who is online

Users browsing this forum: No registered users and 8 guests