Macro for converting timecode, typed without seperators

I'm need a macro that will prompt the user for a input and then convert that input to a timecode format, used in video and audio editing.

Simply, I'd like to enter "01020304" (without quotes, or any 8 digit number) into a variable and then the macro would convert that to "01:02:03;04".

The way I'm thinking to to take the variable and insert the symbol every 2 characters of the string. But I having trouble doing that, or finding a way to do it efficiently. Which something like this should be extremely quick and simple. I'm just not at that level to know how to do it.

I appreciate your help. Thanks!

This should do the trick, with a simple RegEx. If you need help with it, go to regex101.com and enter the RegEx and source data.


Example Results

image


MACRO:   Insert Characters into String [Example]

~~~ VER: 1.0    2018-05-31 ~~~

DOWNLOAD:

Insert Characters into String [Example].kmmacros (3.3 KB)
Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.


image


Questions?

Thank you! I will try it. This was what I was going after. I don't know regex but it is something I've been trying to learn. Starting to try to iterate with . and found that wasn't separating it. Thank you. I'll read up and try it out.

That works perfectly! It looks like you uploaded a macro without the second step (the search) but I recreated it from the picture and it works great! Thanks so much.

I don't know why it was not included in your download.
When I download the macro, it is complete, including the 2nd Action.

RegEx is a great tool, with tremendous ROI. But it does have somewhat of a steep learning curve. Once you get over that initial hump you can become quite productive.

I do all of my RegEx development at this free website:
www.regex101.com

You may also find these sites helpful:
Regular Expressions Quick Start
Regular Expressions -- KM Wiki