Skip to main content
Inspiring
August 10, 2024
Answered

Automation Blocks - Auto Versioning of Sequences

  • August 10, 2024
  • 1 reply
  • 1189 views

Hi @Mathias Moehl 

 

The attached script assists in creating new versions of sequences. It currently....

 

-Makes a copy of the selected sequence

-Moves the new copy into an "old" folder

-Renames the original, selected sequence "Test"

 

I'm looking for help with the renaming part. I want to up-version the original, selected sequence


So if my original, selected sequence is named Sequence_01

I want it to be Sequence_02 after running the script

The copied version would still be _01

 

Any way to get the sript to recognize the number and go up one digit?

This topic has been closed for replies.
Correct answer Mathias Moehl

I just asked ChatGPT for a solution and then wrapped it into a Execute Code Block:

 

Block code is also attached.

I think the combination ChatGPT + Execute Code block is very powerful in all cases where you just want to do manipulation of strings, numbers, searching for certain patterns in strings etc.

1 reply

Mathias Moehl
Community Expert
Community Expert
August 10, 2024

Hi Sam,

 

attached is a version which does what you need. The renaming turned out to be pretty complex.

I created one function "increment name", which increments the name, i..e. if you give it

"foo" as name, it returns "foo_01" and if you give it

"foo_01" it returns "foo_02" etc. or for

"bar0099" it returns "bar0100" etc.

 

Since this requires math on the numbers, you first need to turn the text "01" into the number 1, then increment it to 2, and then add the 0 at the beginning again. For adding these zeros I wrote a second function, "extend to length".
Here is the full code:

 

Cheers,

Mathias

 

 

 

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

This works perfectly! Thank you so much.

And, of course, producers have changed the naming conventions on me!!

Now every sequence ends in a letter: V1A, V1B.

Any way to make the exact same script but the last letter in the sequence goes up alphabetically? Numbers don't change.
Thank you so much for your time and all the work you put into answering our questions. Understood if you don't have time to do this. You're very generous with your talents.

Mathias Moehl
Community Expert
Mathias MoehlCommunity ExpertCorrect answer
Community Expert
August 29, 2024

I just asked ChatGPT for a solution and then wrapped it into a Execute Code Block:

 

Block code is also attached.

I think the combination ChatGPT + Execute Code block is very powerful in all cases where you just want to do manipulation of strings, numbers, searching for certain patterns in strings etc.

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