Copy link to clipboard
Copied
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?
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
...Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Once again you have managed to make the relentless anguish of tasks in Premiere easier and more efficient, thank you, Mathias!
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.