Copy link to clipboard
Copied
How can I apply an expression to multiple layers at once using Automation Blocks? I don't like manually copying and pasting the expression to each layer. I also don't want to open layers and select all properties manually. Instead, I want to enter the property name in a dropdown menu or input box and apply the expression to the selected layers' properties.
Example:
I select multiple layers and run the script. A dialog box opens where I enter the property name, such as "position" and the expression. Then, the script applies the expression to the specified property for all selected layers.
Has anyone done something similar or have suggestions on how to achieve this? I’d appreciate any guidance. Thanks in advance! 😊
1 Correct answer
Here is a second variant of the script, where you can choose in a dropdown, to which property you want to apply the expression:
download (also in Community Library):
Layer Properties/Expressions/Apply Expression to Any Transform Property of All Selected Layers.xml
Copy link to clipboard
Copied
Here is a block script, which applies an expression to the Position property of all selected layers of the active comp.
You can modify the block code easily to use another property instead of position - just select another property (no matter on which layer exactly) and click the "refresh" icon as indicated in the screenshot.
I made the block code such that you can enter the actual expression code in the input panel. Of course, you can also use a popup instead of enter the expresssion code directly inside the block code.
I just added this block script to the Community Library
here is the direct download to the block script file:
Layer Properties/Expressions/Apply Expression to Position of All Selected Layers.xml
Copy link to clipboard
Copied
Here is a second variant of the script, where you can choose in a dropdown, to which property you want to apply the expression:
download (also in Community Library):
Layer Properties/Expressions/Apply Expression to Any Transform Property of All Selected Layers.xml
Copy link to clipboard
Copied
It's working great! Thanks so much for taking the time to create this—it was really helpful.

