• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit Search
0

Automation Blocks - Get Value on Replaced footage

Participant ,
Oct 24, 2022 Oct 24, 2022

Copy link to clipboard

Copied

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

 

 

TOPICS
Scripting

Views

100

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 25, 2022 Oct 25, 2022

Copy link to clipboard

Copied

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":

Screenshot 2022-10-25 at 13.31.59.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 25, 2022 Oct 25, 2022

Copy link to clipboard

Copied

Yet another solution:

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

Screenshot 2022-10-25 at 13.40.25.png

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Oct 25, 2022 Oct 25, 2022

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 25, 2022 Oct 25, 2022

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines