-
Variables returning as Undefined – ExtendScript
Hello all,
Wondering if anyone can point out where I’ve gone wrong here. I’m trying to build a basic script that contains a dropdown list, EditText box and a button.
Everything below is working, apart from my width and height inputs which are returning as “Undefined”.
Thanks in advance,
Ronan
pal.grp.groupOne.createNewProjectButton.onClick = function ()
{
app.project.items.addFolder("00_Render-Comps");
app.project.items.addFolder("01_Pre-Comps");
if (pal.grp.groupOne.resDrop.selection == 0 && this.parent.projName.text = "Project-Title" ) {
alert("Please choose a Resolution");
}else if (pal.grp.groupOne.resDrop.selection != 0){// ---- PROBLEM ----fix the "" marks on output
app.project.items.addComp("'" this.parent.projName.text "'" "-Latin", width1, height1, 1, 10, 30);
}
app.project.items.addComp("text-style-full", width1, height1, 1, 10, 30);
app.project.items.addComp("text-style-reduced", width1, height1, 1, 10, 30);
//Resolution Variables
var w;
if (pal.grp.groupOne.resDrop.selection.index == 1){
width1 = 1920;
}else if (pal.grp.groupOne.resDrop.selection.index == 2){
width1 = 3820;
}else if (pal.grp.groupOne.resDrop.selection.index == 3){
width1 = 2160;
}else if (pal.grp.groupOne.resDrop.selection.index == 4){
width1 = 6240;
}
var h;
if (pal.grp.groupOne.resDrop.selection.index == 1){
height1 = 1080;
}else if (pal.grp.groupOne.resDrop.selection.index == 2){
height1 = 2160;
}else if (pal.grp.groupOne.resDrop.selection.index == 3){
height1 = 2160;
}else if (pal.grp.groupOne.resDrop.selection.index == 4){
height1 = 2700;
}
}