Skip to main content
Inspiring
October 2, 2024
Question

Automation Blocks - Clone, Enable and Replace

  • October 2, 2024
  • 1 reply
  • 4807 views

Hello @Mathias Moehl 

 

The attached script is meant to do the following...

Define variable 'bug' as a particular project item ('Prime_Bug')

-Clone Active Sequence

-(In Cloned Sequence) Enable all instances of Bug in the timeline

-(In Cloned Sequence) Replace '::V5/1' for another project item.

 

However, 2 issues

-Despite the fact that I defined variable 'bug', the script enables ALL disabled clips in the timeline, not just the item assigned to variable bug.

 

-How can I swap out '::V5/1' for a particular clip name? Let's say "Outro.mov".

So instead of that line of code pointing to track 5 / clip 1 in the cloned sequence, I want it to point to "outro.mov", no matter where that clip sits in the sequence. Nothing I try works.

This topic has been closed for replies.

1 reply

Mathias Moehl
Community Expert
Community Expert
October 2, 2024

Hi Sam,

the "for each clip as Bug" does NOT mean "for only the clips which have the project item bug". It just means: When looping over all (yes all) clips, please store each of them in the variable named Bug during the loop. In other words, it just overwrites the content of Bug without looking at it.

 

What you need to do is to loop over all clips and then for each of the retrieve the corresponding project item and check if it actually is the one store in Bug. Comparing the project items is a little error prone, since project items can be specified in. various ways. Hence, to check if two project items are the same, we best compare their ID:

 

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
Inspiring
October 8, 2024

Thank you so much, @Mathias Moehl !

 

Your script gave me the insight I needed to take mine further. I'm nearly there, with currently one command I can't figure out how to execute. The attached script takes the active sequence and does the following...

 

-Clones active sequence

-Renames clone based on active sequence name, with two changes to the name

-Moves clone to a different folder

-Activates 'bug' on cloned sequence

-Replaces Blue_close.mov from Active Sequence with Green_close.mov on cloned sequence

 

What I can't figure out how to do is make Green_Close have the same in-point as Blue_Close. Green_Close starts at frame 0 no matter what frame Blue_Close starts on in the original timeline.

I've attached my script (with an attempt at the in-point replication that doesn't work). Below is a google drive link to a small Adobe Production (the whole package is only 10MB) that I prepped for testing if that is of any interest to you.

 

https://drive.google.com/drive/folders/1EyTovNMuAL9tse5-vWbEtZrhGECDrPOJ?usp=sharing

Mathias Moehl
Community Expert
Community Expert
October 8, 2024

I didn't have the time to download the project and test it, but is this what you need?

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