Skip to main content
Participant
Aug 2, 2023 3:15 PM UTC
Question

AE Script : How to access to a mask property : "Source" - "Masks" - "Effects and Masks"

I want to modify from a script a property of a filter that points to a layer.
This type of property has two values:
1) The layer name
2) the choice between "Source" - "Masks" - "Effects and Masks"
To modify the 1st property I do: property("Layer").setValue(index), and it works 🙂
but how to change the 2nd one ?

8 replies

ConstantinMaier
Inspiring
Aug 3, 2023 11:53 AM UTC

It's not possible. The only way to "set" the "Source / Masks / Effects & Masks" dropdown is to save an ffx preset of the effect with the dropdown set. Include it in your script as a binary string, then create the ffx file for the user at some location on their computer, and apply the preset using Layer.applyPreset().

Translate
Participant
Aug 3, 2023 12:52 PM UTC

Thank you Constantin for this idea.

Translate
Bruno Quintin
Inspiring
May 24, 2025 2:17 PM UTC

Still no solution to this problem other than going through an ffx?

Translate
Dan Ebberts
Community Expert
Community Expert
Aug 2, 2023 6:25 PM UTC

I'm not aware of any way to get to "Source" - "Masks" - "Effects and Masks" via scripting.

Translate
Mylenium
Legend
Aug 2, 2023 5:58 PM UTC

Dropdown controls are simply enumerated arrays. A simple .setValue([2]) could do the trick.

 

Mylenium

Translate
Participant
Aug 2, 2023 6:51 PM UTC

OK but what to put before the .setValue([2])  to say that we want to access the "Source"part (B) ?
The logical solution would be to be able to :

  • access A with : property("Layer")[1].setValue()
  • access B with : property("Layer")[2].setValue()

but it doesn't work 😞
If we can't access to B to change the Source, one solution is to precompose the layer, transferring the attributes to the new composition !

Translate