Automate Project Naming Based on First Video in Timeline in Final Cut Pro

Hello Keyboard Maestro community,

I’m looking for a way to automate the naming of my projects in Final Cut Pro based on the first video in the timeline. Specifically, I want to extract the name of the first video clip in the timeline and set that as the project name.

I’m working with Final Cut Pro and I want to streamline my workflow with a KM macro or any other script available.

Has anyone tackled a similar task or could provide guidance on how to approach this? Any scripts or macros that could help me achieve this would be greatly appreciated.

Since some of us don't have that app, we would need to know the exact key/mouse sequence that you currently use to solve this problem with your eyes and fingers. Or you can wait for someone who has that app, and hopefully they can also check if that app supports AppleScript to fetch the value you want.

One thing you could do in the meantime is create an empty macro, insert the Press a Button action, and use the Button pull down to perform a scan of Final Cut Pro when the appropriate buttons you need in this process are visible. That's not a full solution, just a piece of the puzzle.

Here's a stab at it, but there's no error checking which means if you don't follow my instructions, I have no idea what will happen. Use at your own risk.

Instructions: YOU MUST BE IN THE TIMELINE INDEX. Then run the macro.


Normally, I'd include the macro itself, but in this case I think it's better that you create it by hand. That's so you get an idea of exactly what it's doing, and how fragile it is. There's a possibility you'll need to add some "Pause" actions, although it works on mine without any.

I tried to have it force the Timeline Index to be visible using the menu item Window>Show in Workplace>Timeline Index (with a test beforehand to see if it was already open), but FCP's menus don't seem to want to play well with KM. Maybe you can figure that out.

Good luck. Automating Final Cut is not for the faint of heart, especially if you aren't an expert at AppleScript or JSX.

I've read elsewhere that in current OS releases, you may have to have KM send a "click on menu item" first, then send it again, in order to get the menus to work with KM—maybe that'd work in FC?


Thanks for the tip. This is what I just tried (I don't think the pause is necessary, but I tried it anyway to see if it helped - it didn't):


The result is that the menu and submenu open, but no action is taken.

If I change the condition from "exists but is not marked" to "is not marked", then it clicks the menu item each time, regardless of whether the menu item is checked or not.

Any other ideas? I appreciate the help!

Sadly, that's all I got. It sounds like KM can send the commands to FC, but maybe can't see everything it needs to see relative to the menu's status?


Yep, I agree.

The Window menu should have consistent positioning. If Show in Workspace and Timeline Index do too (eg no items get added/removed to the hierarchy before them) you might get away with image detection over a known area. If the checkmark comes before the menu item you could even include some of the letters (if after it might be difficult if the menu resizes horizontally for longer content).

Thanks, and I thought of that. But I'm not that invested in someone else's macro needs to jump down that rabbit hole. :joy: