Help needed setting up KM with QT and Excel for translation work

I work as a translator and use QuickTime and Excel. I format English scripts into a standardised excel template and then add the translation and need to include the corresponding time codes at the beginning of each speaker. In Excel, each person speaking has their own row and each row is divided into the following four columns: NAME / TIME CODE / ENGLISH TEXT / TRANSLATED TEXT

I find myself constantly switching between the two applications and need help to figure out how to set up Keyboard Maestro to speed up my workflow as I am really stuck and have made several attempts with no success.

I basically need to rewind the video (1 press - 25 frames, 2 presses – 50 frames for example), play then stop, write the translation into the translated field, and then repeat this process to add timecode (00hrs:00mins:00secs).

An added bonus would be the ability to automatically extract the timecode from the video and paste it directly into excel but I would be more than happy with just having total control of everything from my keyboard without having to constantly switch between apps.

Can anyone help?

I am using:

Mac OSX: 10.14.6
KM: 9
QuickTime Pro 7: 7.6.6
Microsoft Excel: 16.37

I'm on Catalina myself, so I can't test if these work with QuickTime Pro, but KM has a series of actions for controlling QuickTime that can be used without QuickTime being the frontmost app, including frame-customizable forward and backward skipping: QuickTime Actions

Just make sure any macros that use these actions are in the built-in Global Macro Group or other non app-specific macro group so that they can be used universally.

As for the timecode, KM can indeed extract and paste that as well, with a little AppleScript and math:

Insert QuickTime Timecode.kmmacros (2.8 KB)

You may need to modify the first line of the AppleScript to say tell application "QuickTime Pro" to get it to work with QuickTime Pro 7 (again, I'm not on Mojave, so I can't test it myself) but once that part's working, it should take the current time of the frontmost video in QuickTime, format it as 00:00:00, and paste it automatically.

2 Likes

Fantastic gglick and thank you for your fast reply!
The QuickTime actions do not seem to work on QT7 but work perfectly with QT10 so I am going with that. Thanks also for the timecode script, works a treat. Cheers and have a great rest of the day.

1 Like

Damn. I spoke too soon. It works with QuickTime 10 but not with QuickTime 7 Pro. I can control the player and the timecode I get is start time of 00:00:00 and not "real" timecode from the timecode track 09:59:40

I modified the beginning of the Timecode script to "QuickTime Player 7" as "QuickTime Pro" did not work but this does not capture from the actual timecode track and does the same as above.

Anyway to get the script to work with QT7? And, is there a way to control the player here as the presets do not work either and I just get a small box that pops up in QT7 (Here is the screen shot)ScreenShot ScreenShot

Can you or anyone else help?

Thanks.

Roman.

Just had a thought. I guess for the timecode I just need to be able to add an offset into the Script so for this particular case it would the 00:00:00 code and add 09:59:40 to synchronise each time, having the possibility of changing this offset for different projects. But unfortunately, I do not know how to do this...

As I said, I'm on Catalina and can't test this with QT7, so if changing it to "QuickTime Pro" and "QuickTime Player 7" didn't work, I can only suggest you try opening QT7's scripting dictionary in macOS's built-in Script Editor app to find out what the correct name is.

As for the small box, that's a conflict palette that appears when two macros with the same hotkey are triggered. I'm guessing you made another pair of back/forward macros for QT7 and gave them the same shortcuts as the ones for QT10? If you did, try disabling the macros for QT10 and the box should go away, hopefully also letting the preset QuickTime control actions work with QT7.

Re the timecode, it's not clear to me where this 09:59:40 number is coming from. Do you mean you need the timecode to capture milliseconds as well, like in your screenshot?

Hello again gglick. Appreciate your help and that fact that you are on Catalina.

Changing the TimeCode script to "QuickTime Player 7" does work so that is ok.

Yes, I did have conflicting shortcuts and removed them, so now no box, but the QT controller presets do not seem to work for QT7, they only work for QT10.

Regarding the time code let me see if I can clear this up for you.
I am talking about two different codes and best to look at the very first frame of the video. QT has its own linear code that starts at 00:00:00. Let's call this TC 1

The videos that I use have time of day code that, in this particular case start at 09:59:40:00, and let's call this TC2. I dropped the last :00 because I work to the nearest second and do not need to capture the frames.

I need to be able to capture TC 2 and not TC 1 so my suggestion of possibility adding an offset to the script to synchronise to what I need but I would not have an idea of how to do this. I hope this is clear and thanks for your help. If we can make the TC work for QT10 then I can use this.

So to summarise,

I need help to figure out how to include an additional step in the “Insert QuickTime Timecode Script.

I have never done this coding before and so a little lost but I know exactly what I need.

Most probably this needs to be inserted just before the last line: “Display text in Window” that I have changed to “Insert text by pasting” and which adds the timecode together with an offset to give me the correct time of day that I need.

In other words, say from 00:10:02 in the QT timeline.

00:10:02 – Timecode from QT
09:59:40 – Add this offset (That i can tweak as needed)

10:09:42 – The result, that I then paste into Excel and that corresponds with the actual time of day timecode that I need.

Hope this makes sense :slight_smile:

Yes, that makes perfect sense, thank you. To add an offset like that, you just need one more step after the AppleScript that returns the timecode from QuickTime:

This calculates the offset in seconds and adds it to the number of seconds returned from QuickTime. I trust it should be self-explanatory to see which numbers in that calculation correspond to hours, minutes, and seconds, so if you need a different offset in the future, you can always change them as needed. If you don't need the offset at all, just disable that action.

Insert QuickTime Timecode 1.1.kmmacros (3.2 KB)

2 Likes

Absolutely fantastic! Thank you so much for your help gglick, I really appreciate it!. Everything works great now.
Have a great weekend.

1 Like

Fantastic thread. You've even got SMPTE-style timecode extractable from the player. Great contribution!

One thing though- as I understand it QT Player 7 (of which I was very fond for its quick-edit abilities) no longer functions in OSX versions after El Capitan (10.11.6). I run High Sierra (10.13.6) and when I try to run .mov files originally encoded for QT 7, I get a "must be converted" dialog. Some convert to the new core foundations, some don't. But the general wisdom is, with no QT 7 frameworks in the OS the player is retired.

I should test whether QT X files can run under QT 7 but it won't surprise me if they don't.

Best, as always,
Loren

Hi gglick

This is brilliant and I have been trying to work out a way of doing this for ages and ages.

In my case it is to do with making comments on a QuickTime movie in the Notes app. I wanted to add the timecode in front of my note to make it easy for my colleague to find the point in the QuickTime the note referred to.

The best I could come up with was making a screen-grab of the timecode in the QuickTime window and using OCR to change to text. But this is so much better.

This is pushing my luck but... is there a way to get the actual "frames number" into a variable? In your Macro seconds (LocalTime MOD 60) are used as the base for all the calculations. But that can't be used to get the frame number. I am guessing QuickTime might have the frame number stored as a value similar to (LocalTime MOD 60) but I haven't worked out what that is.

Even without the frame number your macro has made my day!

Glad I could help. Fortunately, there is a way to get the frame number into a variable too. Just multiply the current playback time in seconds by the video's FPS, then divide it by that number and get the remainder using the modulo (MOD) operator:

Here's an updated version of the macro that includes the frame number. I wasn't able to compare it against a video player app with a built-in timecode, so I'm not 100% sure it works perfectly, but it seemed to work in my own testing:

Insert QuickTime Timecode 1.2.kmmacros (3.8 KB)

Unfortunately, there's no way that I can see to get the FPS number from QT10 programmatically, but it does tell you in the Inspector window:

So as long as you manually plug that number into the appropriate variable before running the macro, the rest should work accordingly.

1 Like

Thank you so much gglick! It works perfectly!

All the QuickTimes I view are at 25fps so I just changed that to the figure in your LocalFPS action.

I have checked your macro against a video with burnt-in timecode and it is spot on.

Thank you again. This will save me so much manual typing!

1 Like

Brilliant gglick!

1 Like