Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions ExtendScript – Items in my dropdown list are repeating – Help

Tagged: 

  • ExtendScript – Items in my dropdown list are repeating – Help

    Posted by Ronan De lacy on January 12, 2021 at 2:19 pm

    Hello forum…

    Wondering if anyone on here can explain where I’m going wrong here. I have a dockable UI which contains a dropdown list that pulls in all layer names from a specific comp. I kinda have it working, however, the item names in the dropdown are duplicating and combining on each line.

    See screenshot and Scrips snippet.

    Thanks in advance, any help appreciated!

    var proj = app.project;

    var sytleFull = proj.item(5);

    var myList = new Array();

    for(var i=1; i <= sytleFull.numLayers; i++){

    myList[myList.length] = sytleFull.layer(i).name;

    pal.grp.groupTwo.asignGrid.add("item", myList);

    }

    pal.grp.groupTwo.asignGrid.selection = 0;

    Ronan De lacy replied 5 years, 3 months ago 2 Members · 3 Replies
  • 3 Replies
  • Andrei Popa

    January 12, 2021 at 2:59 pm

    You are adding the entire array each time, Try this instead on line 6

    pal.grp.groupTwo.asignGrid.add(“item”, sytleFull.layer(i).name);

  • Ronan De lacy

    January 12, 2021 at 3:04 pm

    Hi Andrei. That worked, thanks so much!!

  • Ronan De lacy

    January 27, 2021 at 11:15 am

    Hi Andrei,

    I have a follow up question to my last (sorry).

    <font face=”inherit”>If I wanted to filter the results that appear in my dropdown list by label color, how should I go about it? for example, if </font>I<font face=”inherit”> only want the list to contain layers that have the have a label color of red (1)?</font>

    <font face=”inherit”>
    </font>

    <font face=”inherit”>
    </font>

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