Copy link to clipboard
Copied
Hello,
How can I have whatever is selected in the Expression Controls > Dropdown Menu Control (which was renamed to Layer Source For Grid) as a variable.
After that how do I access the VALUE of the selected layer in this case "BOX" Expression Controls > Slider Control > Rows and Columns.
Right now I have something like this, any help with what I am doing wrong is appreciated.
startButton.onClick = function(){
var comp = app.project.activeItem;
var layGrid = comp.selectedLayers[0];
var laySelect = layGrid.property("Effects").property("Layer Source For Grid").property("Layer");
var selectR = laySelect.property("Effects").property("ROWS").property("Slider");
var selectC = laySelect.property("Effects").property("COLUMNS").property("Slider");
I have attached 2 screenshots as a reference.
Thank you in advance.
the value of a layer control dropdown is the index of the selected layer.
Hence, you should be able to do something like
var laySelectIndex = layGrid.property("Effects").property("Layer Source For Grid").property("Layer").value;
var laySelect = comp.layer(laySelectIndex);
var selectR = laySelect.property("Effects").property("ROWS").property("Slider").value;
var selectC = laySelect.property("Effects").property("COLUMNS").property("Slider").value;
Copy link to clipboard
Copied
the value of a layer control dropdown is the index of the selected layer.
Hence, you should be able to do something like
var laySelectIndex = layGrid.property("Effects").property("Layer Source For Grid").property("Layer").value;
var laySelect = comp.layer(laySelectIndex);
var selectR = laySelect.property("Effects").property("ROWS").property("Slider").value;
var selectC = laySelect.property("Effects").property("COLUMNS").property("Slider").value;
Copy link to clipboard
Copied
Perfect. Thank you, good man.