Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Dynamic Text in UI Panel Extendscript

  • Dynamic Text in UI Panel Extendscript

    Posted by Phil Largilliere on February 19, 2018 at 2:02 pm

    Hi everyone,

    I’m tyring to create a UI Panel to get some currently expressions codes for my colleagues, but I really don’t know how to display infomartions in my text zone.
    I already wrote this, it’s pretty dirty for now, but this is how it should work :

    My text zone is empty, then when I click on one of the radio button (or on the getCodeBtn), it will look for differents codes (I will enter them into a array) and display it in my text zone…


    exprCode = "";

    {
    function myScript(thisObj) {
    function myScript_buildUI(thisObj) {
    var myPanel = (thisObj instanceof Panel) ? thisObj : new Window("palette", "Menu Tests", undefined, {resizeable:true});

    res="group{ \
    orientation:'column', align:'left',\
    code : Group {orientation:'row', alignment:['fill','fill'], spacing:5, \
    myRadioButton01: RadioButton{text:'Opacité', tooltipActive:'2 Lettres'},\
    myRadioButton02: RadioButton{text:'Texte', tooltipActive:'2 Lettres'},\
    myRadioButton03: RadioButton{text:'Code', tooltipActive:'2 Lettres'},\
    myRadioButton04: RadioButton{text:'Flash', tooltipActive:'2 Lettres'},\
    }\
    textZone : Group { \
    orientation:'column', alignment:['fill','fill'], spacing:5, \
    heading: Group {alignment:['fill','top'], lbl: StaticText { text:'Code à copier', alignment:['left','bottom'] }, \
    }, \
    getCode: EditText { text:'', properties:{'multiline':true}, alignment:['fill','fill'], minimumSize:[500,120] }, \
    }, \
    cmd: Group { \
    alignment:['fill','bottom'], \
    getCodeBtn: Button { text:'Chopper un code', alignment:['right','top'], preferredSize:[-1,20] }, \
    }, \
    }";

    myPanel.grp = myPanel.add(res);

    myPanel.grp.cmd.getPropPathBtn.onClick = afficheCode;
    myPanel.grp.textZone.getCode.text = exprCode;

    function afficheCode()
    {
    exprCode = "Ta mémé !"
    alert(exprCode);
    myScript(this);
    this.parent.parent.textZone.heading.getCode.enabled = true;
    }

    myPanel.layout.layout(true);

    return myPanel;
    }

    var myScriptPal = myScript_buildUI(thisObj);

    if(myScriptPal != null && myScriptPal instanceof Window){
    myScriptPal.left();
    myScriptPal.show();
    }
    }

    myScript(this);
    }

    Hope it’s clear enough :/
    Thanks for your help

    Phil Largilliere replied 8 years, 2 months ago 2 Members · 2 Replies
  • 2 Replies
  • Joseph Simons

    February 20, 2018 at 3:46 am

    Hi Phil,

    I can’t directly answer your question, but found your post as I was attempting to do something similar. Your base code looks exactly like what I’ve been referencing in David Torno’s online course, so I’m assuming you’re in a similar place as I am.

    I found this resource for all the possible edittext properties, which I think you’ll find useful.

    https://jongware.mit.edu/iljscs6html/iljscs6/pc_EditText.html

    Good luck with your coding endeavors!

    Joseph

  • Phil Largilliere

    February 22, 2018 at 1:36 pm

    I didn’t find how it works… Do you know a place where I can find more tutorials as David Torno did on provideocoalition ? Or on Adobe website ?

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy