• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

AE Scripting assessing Expression Controls

Participant ,
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

284

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

Community Expert , 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;

Votes

Translate

Translate
Community Expert ,
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;

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects

Votes

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
Participant ,
Jul 04, 2022 Jul 04, 2022

Copy link to clipboard

Copied

LATEST

Perfect. Thank you, good man.

Votes

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