Hey Jeroen
Sorry I don’t have more time to put in this, but I’ve got it close. The correct number of items are showing up in the drop down (Plus one placeholder item, which could be removed after populating). Just haven’t troubleshot why the names aren’t showing up.
{
function myScript(thisObj) {
function myScript_buildUI(thisObj){
var myPanel = (thisObj instanceof Panel) ? thisObj : new Window("palette", "My window name", undefined,{resizeable:true});
res = "group{orientation:'row',\
groupOne: Group {orientation:'column',\
masterButton: Button{text:'Master'},\
layerButton1: Button{text:'First Name'},\
layerButton2: Button{text:'Last Name'},\
layerButton3: Button{text:'Gender'},\
layerButton4: Button{text:'Phonenumber'},\
layerButton5: Button{text:'Email'},\
layerButton6: Button{text:'Work'},\
layerButton7: Button{text:'Streetname'},\
layerButton8: Button{text:'Housenumber'},\
layerButton9: Button{text:'City'},\
layerButton10: Button{text:'Subs'},\
DDL: DropDownList {properties:{items:[' ']}},\
},\
}";
myPanel.grp = myPanel.add(res);
var masterComp;
for (var i = 1; i <= app.project.numItems; i ++) {
if ((app.project.item(i) instanceof CompItem) && (app.project.item(i).name === 'master')) {
masterComp = app.project.item(i);
break;
}
}
var myList = new Array();
for(var i=1; i <= masterComp.numLayers; i++){
myList[myList.length] = masterComp.layer(i).name; // Leaving this in for your future use.
var newitem = myPanel.grp.groupOne.DDL.add('Item', undefined, masterComp.layer(i).name );
}
myPanel.layout.layout(true);
// return window
return myPanel;
}
var myScriptPal = myScript_buildUI(thisObj);
if((myScriptPal != null)&&(myScriptPal instanceof Window)){
myScriptPal.center();
myScriptPal.show();
}
}
myScript(this);
}