Copy link to clipboard
Copied
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.
you can check the matchName of the property
if(props[i].matchName == "ADBE Scale") {...}
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
you can check the matchName of the property
if(props[i].matchName == "ADBE Scale") {...}
Copy link to clipboard
Copied
You're my hero
Find more inspiration, events, and resources on the new Adobe Community
Explore Now