Timecode and Notes Segmentation Question

Hello All,

I'm so sorry to ask this if it's too basic as I believe it's an error with my REGEX but I have the following formatted text:

-Notes for the project. This needs to be copied etc

I have to place each of these into a Google sheet so I need the first timecode as one variable, the second timecode after the "-" as another variable, and all the text after the remaining "-" following the 2nd timecode as a 3rd variable so I can then paste each one into the proper slots in the Google Sheet.

For some reason my code is only copying the first 00:00 numbers of the timecode and not copying all of the text after the 2nd timecode slot and was wondering if anyone knows a simpler way to do this in KM?

Thank you so much for your help!

You can refer to parts of a delimited string by one-based index

(index 0 holds the length of the array of parts)

Times Split.kmmacros (2.3 KB)

1 Like

Ah that makes so much more sense! Thanks so much!

1 Like

See the Variable Arrays section (particularly How to Use Custom Array Delimiter) lower down on this page:

manual:Variables [Keyboard Maestro Wiki]

When you've got consistently-presented text you can go straight to substrings. Assuming your text is as above (separate lines), you know the first TP will be characters 1 through 11, the second 14 through 24, and the notes are 27 through to the end:

Substrings Demo 2.kmmacros (4.3 KB)

Hey Matthew,

One more bite...


Regex – Capture Time Codes and Notes v1.00.kmmacros (6.9 KB)
Keyboard Maestro Export