Skip to main content
m1jackson
Inspiring
October 24, 2022
Question

Automation Blocks - Get Value on Replaced footage

  • October 24, 2022
  • 2 replies
  • 372 views

So I've followed along with the tutorials and set a script to replace footage in a template. My question is this, now that the footage has a new name, how do I identify it to get an attribute like duration via script since I won't know it when the script is written?

 

Original file = TemplateMovie

Replaced file = ABCD5436

 

 

This topic has been closed for replies.

2 replies

Mathias Moehl
Community Expert
Community Expert
October 25, 2022

Yet another solution:

You can use the Replace in Text block to update any variable pointing to your project item:

Note that the variable "Project item" contains just a string with a path describing the project item. Hence, you can simply to search & replace like with any other texts, too.

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
m1jackson
m1jacksonAuthor
Inspiring
October 25, 2022

The only issue I see with this is that "Template Movie" and "ABCD5436" have to be manually entered in the Automation Blocks interface rather than using a variable.

 

I'm preferenced to Solution 2 in the prior response, but all these are very helpful as I think they can be used in different cases. Thank you.

Mathias Moehl
Community Expert
Community Expert
October 25, 2022

In the replace text block, you can also use variables instead of hard-coded names.

And if you have a variable containing the full file path, you can use the Tinker File Path block to extract only the file name from it.

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
Mathias Moehl
Community Expert
Community Expert
October 25, 2022

One easy solution:

Rename the project item of your template manually before running the script. If you replace the file of a project item, Ae only renames the project item, if it has not been renamed manually before.

 

Example

your file is named "TemplateMovie.mp3" and now the project item automatically also has the name "TemplateMovie.mp4". Now rename the project item to "my template movie", for example.

If you now run an Automation Blocks script which replaces the file by "ABCD5436.mp4" then the project item name will stay "My template movie" and hence, you can still access it with that name.

 

Solution 2:

If the project item is used in some layer of your project, you can retrieve the project item with the block get attribute "source item" of layer.

In this example, I retrieve the project item of the first layer of the comp with name "my comp":

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