Skip to main content
Participating Frequently
August 16, 2024
Question

Automation Blocks - Can you add items to a sequence based on a partial name match?

  • August 16, 2024
  • 1 reply
  • 235 views

I am trying to set up a workflow that will add a clip to a sequence based off of a partial match in both the clip and seqence name. 

 

For example, an imported clip contains "30 16x9" in the name and I want to place it in the corresponding sequence that also has 30 16x9 in the name. I know there has to be a way using logic with the search in text block but I cant quite figure it out. 

 

I have no problem identifying the correct sequence, but how would I target the corresponding clip based on a partial match? I created a variable 30 16x9 SPLS that does the same search in text to the bin the clips are in, but I get a "cannot find project item" error. Any way to fix what I currently have going? Or is there a better way to achieve the desired result?

 

Any info is much appreciated! Thank you

 

 

 

This topic has been closed for replies.

1 reply

Mathias Moehl
Community Expert
Community Expert
August 16, 2024

Your variable "30 16x9 SPLS" just contains the value 0, not a list of clips. You just search in the name of the project item "protection master" for the text "30 16x9 SPLS" which is not contained in "protection master". Hence, it returns the value 0, since the search function returns the position where the text was found or 0 if it was not found (see here)

 

If you want to insert all footage elements, which contain "30 16x9" in their name into all sequences which contain "30 16x9" then you need to nest two loops inside each other like this


for all sequences as "my sequence"

     if name of "my sequence" contains "30 16x9"

          for all footage items as "my clip"

               if name of "my clip" contains "30 16x9"
                    insert "my clip" into "my sequence"

If you want to process many sequences, each of them with their own search word, and you have a way to retrieve the search word from the sequence name, then you can change the logic as follows:

 

for all sequences as "my sequence"

     save searchword for "my sequence" in variable "search word"

     for all footage items as "my clip"

          if name of "my clip" contains "search word"
               insert "my clip" into "my sequence"

 

Let's say the search word like "30 16x9" is always at the very end of the sequence name and it is always exactly 7 characters long. Then you can get the search word by using the Get Substring block.

 

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