It saves .srt subtitle files for any number of video clips using Final Cut Pro’s automatic transcription feature. As in this post, I wish I could have found a similar KM macro to start from, but I could not.
It took me a long time to figure out all the pause times necessary to get this to work, and even now it fails occasionally, I think because FCP does background processing in various ways. I tried to disable these, but I still get surprised sometimes. Also, I struggled a lot with the conditions for starting and ending the macro, and of course, learning all the keyboard shortcuts. Is my repeat loop the right choice? I don't like that I have to enter a number of repeats.
Details:
To use the macro, the user must first (1) import the video clips into the “browser” section of FCP, (2) make a new project, (3) highlight the first clip and then trigger the macro. The macro then:
Gets the filename of the first clip and stores it on the clipboard
Adds the clip to the timeline
Transcribes the audio in the clip into captions
Converts those captions into an .srt type subtitle
Exports that .srt file using the filename
Clears the timeline
Repeats from step (1) unless the filename matches the clipboard
I’m not interested in embedding CEA-608 type subtitles, just .srt, and according to the FCP user’s guide srt files can be imported or exported as separate files, but they can’t be embedded. So after I generate the .srt using FCP, I embed them using ffmpeg.
I am not sure about all the details of this macro but one thing that might help is pause until and setting an action delay so you don't have to reset so many pauses in your macro.
You can use the following to quickly create a few actions to use for your macro depending on what approach you want to use for the delays. Create Action - Delay Throughout Macro.kmmacros (34 KB)
The idea of a universal pause between actions sounds good at first, but I wonder if it really makes sense with this kind of macro? Most actions here are menu selections and keystokes that require no pause. Yet there are about 2 dozen actions so that’s an extra 20-some seconds for each loop through if you use a 1s universal pause, and nearly 50 seconds if you use 2s. Adding a minute to each loop can really add up if you're doing dozens of files -- which, of course, is the whole point of making a macro.
As I wrote, I spent a lot of effort coming up with the 7 pauses in this macro, which last 1, 1, 4, 2, 4, 2, and 1 seconds = 15s total.
I just don’t see a way around learning about the need for those longer pauses, and this is what I find to be one of the most challenging things about making working KM macros.
For future reference it is good to include an image of your macro in your post. Most folks here will not want to download a macro without seeing an image of it first and very often the image contains enough info that there is no need to download the macro.
This will only pause the time needed for the menu item to become enabled rather then waiting 4 seconds every time. It will also pause even longer than 4 seconds it that it is how long it takes that menu item to become active - so, a much more robust solution.
Just for ref, here is what that menu looks like if that item isn't active (the "Export Captions..." item is greyed out):
This is brilliant, something I never would have thought of, and exactly the kind of help I was seeking. After doing exactly as you described I ran several tests and it worked well. There should be some sort of list of the top 20 KM macro tips -- and I'd nominate this one. Thanks!
I've now posted an image, but making images of KM macros has also been difficult for me: if I expand each action so you can see all needed details, the image becomes ridiculously big, even when split into pieces and placed side by side. It took me quite a while to figure out the method I've now reached: putting needed info in comments so that all actions can be collapsed and you still see what's needed. Maybe someone should post a macro that automates that process...
Another tip to make that easier, select the Macro and use the Keyboard Maestro menu item Edit>Copy as>Copy as Image Then you can just paste into your Forum post with the normal ⌘V
I am glad you got what you were looking for and yes I wouldn't want to slow your macro down at all.
I agree a pause between everything would make the macro not save you time at all. More of just an idea for quickly changing spots that you would adjust the time of things that are the same.
The trouble with this approach, and I have done this a lot is these things change depending on what your computer is doing, software updates and many other factors. When you repeat something over and over it gets loaded in to RAM and becomes faster and then the next time you try that when you first open the app it doesn't work and it is frustrating.
My appoligies for not explaining the pause until action more.
Here is a link to the Wiki for more info.
Comtrol (Command+Control (⌘⌃)) + a you can type pause and see all the pause actions and then in those actions you can click on the cog wheel and at the bottom Peter has done an excellent job of making direct links to the wiki by clicking on help.