I several text transcripts from YouTube videos that have timestamps every-other line.
I want to change those timestamps into links and calculate the total seconds so the link can skip to that point in the video and resave the rich text.
For example here is a video: https://www.youtube.com/watch?v=KzvaDZVSk3c
Here's part of the transcript:
00:00
today we're going to talk about
00:01
self-persuasion but we're going to speak
00:03
about it from the perspective of
00:05
nlp frame control
00:08
in our last video we spoke about the
00:11
topic of frame control
00:13
i brought it up a few times and the
I want to replace each timestamp line to be a link to the YouTube url with the total seconds added so it links directly to that point in the video, for example if the transcript had a line that was 30:42 it would replace it to make it a link like this:
To get the to total seconds I was thinking to cycle through each line of the text transcript and run an if else statement to see if the line contains ':', and calculate from minutes into seconds by splitting the line at the ':' then multiply the first split by 60, and then add add to the second split to get the total seconds.
Does anybody have a suggestion for the best way to approach this? Maybe with regex?
The "Search Variable" action has "Notify Aborts Macro" and "Notify on Failure" turned off. The "If" checking %ActionResult% tells whether the search found anything or not:
I made some progress per your suggestions. The issue I'm having now is I'm not sure what syntax needs to be used to export a RTF file with formatted links. I tried to use both html and RTF format but they don't parse when saving the new file. Do you know how I export my transcript with the links in RTF format? In the example below you will see i have 3 different actions for "set variables timestamp to text", these were the 3 different syntax i tried but none of them export the rtf with the formatted link. Any suggestions would be really appreciated.
No I don't. I couldn't create PDFs with hyperlinks either, when I tried a while back.
I have two thoughts. The first is to format it in HTML and save it as an HTML file. If you're going to email the results, this might actually work well. The second is that depending on what app is used to open the file, often-times you can right-click and there's an option to "Open URL" or something like that.
Other than that, I don't have any ideas.
@ccstone Hey Chris - do you have any idea how to save a document (of any type, really) so that URLs are clickable hyperlinks? Thanks.
Printing to PDF and saving Word as PDF doesn't create clickable links, at least not in my experience, and I tried them extensively a could of years ago. I'd love to be proven wrong, though.
Well, that's interesting! I have a PDF I made in October of 2018, and the links weren't clickable then, but they are now. So since the PDF didn't change, something in the OS must have. Or else I'm just crazy, which isn't outside the realm of possibility.
I'm not sure if my question was clear... what I meant to ask was how to I export text that is inside a KM variable... how do I export out of KM to a file that has the links formatted correctly. What I want is this:
In order to create a hyperlink that is clickable, you need to create the HTML code and then save as a .html file. Then open that file in any web browser.