Creative Communities of the World Forums

The peer to peer support community for media production professionals.

  • Posted by Fabio Apelbaum on June 3, 2016 at 5:31 pm

    Hi Guys, quick question!

    I have a script that opens a UI with multiple “textedit” fields that are attached to my text layers within my comps, currently when I open the UI, the textedit fields shows the current text in the text layers. Now, I added to my UI a button that replaces the information of my text layers to something else…. and I would like to have all my textedit fields to refresh and show the current text in the layers without having to close and reopen my UI… Is there a way to do this?

    I tried using a function such as:

    function updateUILayout(container){
    container.layout.layout(true); //Update the container
    myWin.layout(true); //Then update the main UI layout
    }

    But, that updates the layout, not the info within the textedit fields…

    Any help will be appreciated! thanks in advance!

    Fabio Apelbaum replied 9 years, 11 months ago 2 Members · 2 Replies
  • 2 Replies
  • Xavier Gomez

    June 5, 2016 at 8:15 am

    To change a text in a text widget, simply do theTextWidget.text = newText;
    There is no need to relayout, the text will be changed.
    But… you have to specify the new text. In your case, this means retrieving theTextLayer.text.sourceText.value for every pair text layer/text widget that you have.

    Xavier

  • Fabio Apelbaum

    June 6, 2016 at 1:39 pm

    Thanks Xavier, as always!

    I have so many text edit fields that I was hoping there was any sort of code that would just refresh them or restart the UI. Nevertheless, your recommendation certainly works!

    Take care,

    Fabio

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