Skip to main content
Participating Frequently
February 14, 2025
Answered

How to Apply an Expression to Multiple Layers at Once Using Automation Blocks

  • February 14, 2025
  • 2 replies
  • 1175 views

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! 😊

Correct answer Mathias Moehl

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

2 replies

Mathias Moehl
Community Expert
Mathias MoehlCommunity ExpertCorrect answer
Community Expert
February 14, 2025

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

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
Participating Frequently
February 15, 2025

It's working great! Thanks so much for taking the time to create this—it was really helpful.

Mathias Moehl
Community Expert
Community Expert
February 14, 2025

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

 

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