Skip to main content
zachneel
Participating Frequently
December 13, 2020
Answered

Is there any way to identify what property is selected with scripting?

  • December 13, 2020
  • 1 reply
  • 1367 views

I'm writing a script to be able to change the value of a property based on a user input, and I'm wondering if there's a way to identify exactly what property is selected.

 

I mainly want to identify if they have scale selected so that instead of needing to input an x and y value you can just input one so it'll slot into both spots.

Correct answer Mathias Moehl

you can check the matchName of the property

if(props[i].matchName == "ADBE Scale") {...}

1 reply

Tomas Sinkunas
Legend
December 13, 2020

In your curent composition, you can retrieve an array of selected properties with: app.project.item(index).selectedProperties

Or on a layer, with  app.project.item(index).layer(index).selectedProperties

More info here: https://ae-scripting.docsforadobe.dev/layers/layer/#layer-selectedproperties and here https://ae-scripting.docsforadobe.dev/items/compitem/#compitem-selectedproperties

 

zachneel
zachneelAuthor
Participating Frequently
December 13, 2020

Thanks for the quick reply Tomas! I know you can get an array of selected properties, but I'm more wondering if there's some of way of specifically seeing if one of those is the scale property for example.

 

something like:

var props = app.project.activeItem.selectedProperties;
for (i=0; i<props.length; i++)
     {
      if (props[i]==scale)
           {
            do something
            }
     }

 Obviously I know it wouldn't be this exactly I'm just wondering if I can do something along these lines

Mathias Moehl
Community Expert
Mathias MoehlCommunity ExpertCorrect answer
Community Expert
December 14, 2020

you can check the matchName of the property

if(props[i].matchName == "ADBE Scale") {...}
Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects