after-effects

After effects Script - Documentations for passing a regexp text into the Window.add() function


I'm learning how to make UI panel in AE and I've got this code on Youtube

      var myPanel = (thisObj instanceof Panel) ? thisObj : new Window("palette", "Dockable Script", undefined, {resizeable:true, closeButton: false});

      res = "group{orientation:'column',\
                groupOne: Group{orientation:'row',\
                    createCompButton: Button{text:'Create Comp'},\
                },\
                groupTwo: Panel{orientation:'row',\
                    deleteCompButton: Button{text:'-'},\
                    deleteText: StaticText{text:'Delete Active Comp'},\
                },\
                groupThree: Group{orientation:'row',\
                    closeButton: Button{text:'Close'},\
                },\
            }";

     myPane.grp = myPanel.add(res);

But I coudn't find any documentations about this type of wrapping every thing into a regexp text. All I found were just like this:

myPanel.createCompButton = myPanel.add('button', [10,10, 120, 60], "Create Comp", {name: 'create'});

Is there a documentation for that kind of wrapping?


Solution

  • That "wrapping" of the value for res in the example code is called a "resource string" and it's like semantic markup for UIs driven by Adobe's framework.

    Here is the documentation on the topic:

    https://extendscript.docsforadobe.dev/user-interface-tools/resource-specifications.html?highlight=resource%20string#resource-specifications