AE Scripting assessing Expression Controls

Explorer ,
Jul 04, 2022 Jul 04, 2022

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.

TOPICS
Scripting

Views

51

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Adobe Community Professional , Jul 04, 2022 Jul 04, 2022

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;

Likes

Translate

Translate
Adobe Community Professional ,
Jul 04, 2022 Jul 04, 2022

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;

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 04, 2022 Jul 04, 2022

Copy link to clipboard

Copied

LATEST

Perfect. Thank you, good man.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines