It would seem like a basic loop with a calc on the variable so that the following instances of the string gets updated.
I'm running KM on another computer so can't easily copy and paste so I will sum up here:
Prompt for User input and add vars for episode, Scene and Number
Read the specific text file to the System Clipboard
Search and Replace System Clipboard using String
in my case the specific string is static
and replace with the above variables %Variable%Episode%%Variable%Scene%%Calculate%Number+10%
So it finds and replaces all the instances of my specific string with the variables I set and adds 10 to each instance's number var. But I want it to loop and add 10 to the var and then write that value to the following string, ecetera.
I understand. The first file is my export from Avid, the second is the result after I ran my macro.
So I can set the first part of the string but not get the number to add on by 10 correctly. Also it needs to keep the 4 digits. The search string will always be the same.
@ This file written with the Avid Caption plugin, version 1
01:00:20:12 01:00:23:22
PP_116_TST_0010
01:00:33:09 01:00:38:12
PP_116_TST_0010
01:00:38:12 01:00:44:09
PP_116_TST_0010
01:00:44:11 01:00:47:04
PP_116_TST_0010
01:00:55:17 01:00:57:19
PP_116_TST_0010
01:01:04:04 01:01:08:16
PP_116_TST_0010
The end result should be:
@ This file written with the Avid Caption plugin, version 1
01:00:20:12 01:00:23:22
PP_106_621_20 ----- this needs to start at 0010
01:00:33:09 01:00:38:12
PP_106_621_20 ---- this then needs to calculate to 0020
I input it as part of the Input prompt to set the variable at 0010 but it can also be read from the first item since it will always be that starting value.
I've been playing with it and getting close to the results I want. But the main action is definitely working. I just need to remove the first few lines, then add them back after the script, remove the last line and boom, I'm figuring it out. Thank you.
For my own amusement and practice (because I'm sure @ComplexPoint's already provided a good answer)...
You have a list of {timecode, label} pairs. The label is a_b_c_d
You want to keep the timecodes as they are but change the label to v_x_y_z ---- position*10+(first d)-10, the final part padded to 4 numbers.
You have four "codes" but are only prompting for episode and scene -- I assume that's y and z? Is the "PP_106_" a constant then? Or is "PP" a constant and x=b-10, or user input?