Updated (28th September 2016):
Based on lots of fantastic user feedback, I’ve made some major improvements to the script.
This latest version has been tested on both macOS 10.10.5 and 10.11.6 with Final Cut Pro 10.2.3 and Hammerspoon 0.9.48.
I’ve also changed around the shortcut keys to avoid conflicts with other commands and programs:
L = Launch Final Cut Pro (System Wide)
F1 = Show list of Keyboard Shortcuts
H = Highlight Browser Playhead
F = Reveal in Browser & Highlight
S = Single Match Frame & Highlight
D = Reveal Multicam Clip in Browser & Highlight
G = Reveal Multicam Clip in Angle Editor & Highlight
B = Change Backup Interval
T = Toggle Timecode Overlays
Y = Toggle Moving Markers
P = Toggle Allow Tasks during Playback
M = Select Color Board Puck 1
, = Select Color Board Puck 2
. = Select Color Board Puck 3
/ = Select Color Board Puck 4
1-9 = Restore Keyword Preset
1-9 = Save Keyword Preset
For those that are interested, I’m currently working on a shortcut key to move a storyline up and down in position on the timeline, and another to add audio fade handles. If you have any other ideas, requests, or come across any bugs or issues please let me know in the comments below or shoot me through an email.
Please be aware that I’m a filmmaker, not a programmer, so use at your own risk!
If you find this script useful, please consider making a small donation or buy some cool Wizards Merchandising so that I can continue hacking away in my spare time:
You can download the latest script here (version 0.20 – 28/09/2016 @ 1412).
After downloading and installing Hammerspoon, the files contained in the above ZIP should be moved to ~/.hammerspoon/. For more detailed instructions read the original blog below.
Thanks for testing! Happy Cutting!
Over the last few days, I’ve been having lots of discussions with other Final Cut Pro users on social media about how annoying the Reveal in Browser (aka ‘Match Frame’) feature in FCPX is. The problem is that if you have hundreds of clips within your browser, when you match frame it’s really hard to instantly visually see where the playhead is in a sea of other clips. It’s also really annoying if you’ve got your playhead at a specific position in the browser, then continue editing in the timeline for a hour or so, and want to easily jump back to that browser playhead position to continue where you left off. It’s VERY hard to spot which clip is selected and where the tiny white playhead is hiding in the browser!
To try and solve this, I quickly threw together a simple little AppleScript that uses the macOS Accessibility API to find out where the browsers playhead currently is, and then instantly move the mouse cursor to the playhead position. It was a bit of a hack job, but after a bit of experimenting, it finally worked. However, as many people commented, it’s a pretty bad idea to move the mouse as it breaks all the Apple Human Interface Guidelines. After playing with it for a while, I have to agree – it’s a bit strange having the mouse move on you!
One of the original ideas that Scott Simmons suggested was to somehow highlight the playhead position in the browser. My idea was to do this with a GIANT arrow, so the editor can instantly see where the playhead is. Despite a lot of Googling, I couldn’t work out how to do this with AppleScript or Automator, and I don’t have the time (or the skills) to jump into Xcode. Luckily however I discovered something called Hammerspoon.
To quote the manual: “At its core, Hammerspoon is just a bridge between the operating system and a Lua scripting engine. What gives Hammerspoon its power is a set of extensions that expose specific pieces of system functionality, to the user”.
Essentially – it’s like a more powerful and geekier version of Automator, and allows you to script a bunch of stuff to speed up everyday tasks. For example, you could write a script that changes which wireless access point you’re connected to with a click of a button, or have an alert pop up on your screen when a render is finished. There’s lots of examples here.
What I discovered is that Hammerspoon has the ability to not only handle AppleScript (so I could reuse the code I’ve already been playing with), but it can also draw things on the screen – which is exactly what I needed.
It’s also free, and open source. Bonus!
It uses the Lua scripting language – which I’ve never used before, but it seemed simple enough.
So, with a LOT of trial and error, playing with my new favourite tool UI Browser, reading through heaps of examples, and thanks to some helpful Tweets – I was able to throw something together that seems to work!
Basically, the script I’ve made does three things (so far):
- When you press CONTROL + OPTION + COMMAND + F it will perform a normal match frame in FCPX, but will also draw a red circle around the browser playhead temporarily so you can easily see where the playhead is.
- When you press CONTROL + OPTION + COMMAND + H it will draw a red circle around the browser playhead (without doing a match frame). This is helpful if you’re just working in the browser, but you’ve ‘misplaced’ where the playhead currently is.
- When you press CONTROL + OPTION + COMMAND + S it will perform a normal match frame, but it will also take the name from the clip you are match framing, and apply it to the search tool, so that only the match frame clip appears in your browser. I call this a “Single Match Frame”.
I’ve tried to code it so it works with all the common window layouts, however I’ve only tested it with FCPX 10.2.3 and macOS 10.11.6 on a MacBook Pro and a 5K iMac – so it MAY not work well on other systems. If it doesn’t work for you – let me know in the comments below.
I’ve noticed that the script can get very sluggish when you have lots (i.e. more than 500) clips in your event – whereas it’s really quick and snappy with events that only 50-100 clips. This seems to be a limitation of AppleScript, which I’ve been unable to solve thus far (if anyone has any ideas, please let me know!).
You’re also MORE than welcome to modify the script for your own needs (or fix my poorly designed code). I’ve been experimenting with it for saving/restoring FCPX window layouts, and also trying to implement a scrolling timeline – so there’s definitely some cool stuff you can do with it! I think a keyboard shortcut for “apply audio fade handle” is next on my list! If you come up with something cool, please make sure you share it in the comments below.
DISCLAIMER: I’m a filmmaker, not a programmer, so use this at your own risk. This script is provided “as is” with no warranty, so don’t come back to me if it blows things up. I’ve done very little testing outside my own machine, so the script may not work on all systems and configurations.
If you want to test it out, here’s how:
- Download Hammerspoon. It’s free.
- Hammerspoon comes as a ZIP file. Unzip it and drag the Hammerspoon.app to your Applications folder.
- You can now run Hammerspoon. The first time you run it you’ll be presented with a Preferences panel:
- To actually function properly, Hammerspoon needs Accessibility permissions. Click the Enable Accessibility button.
- You’ll then be presented with a Security window like the below. Click Open System Preferences.
- This will open the Security & Privacy system preferences. You’ll need to unlock the panel by clicking the paddock in the left hand corner of the screen, and enter in your computers password. Once the panel is unlocked, you’ll need to make sure the Hammerspoon item is ticked as per below. Once done, you can now close this window.
- Out of the box, Hammerspoon does nothing. What you need to do now is feed it some code!
- So let’s Quit Hammerspoon for now.
- You can download the latest script at the top of this page (I’ll be constantly updating this link as I slowly improve the script based on your feedback). This also comes as a ZIP. When you unzip it, you’ll find a file called init.lua and a folder called hs. This is what we need to give to Hammerspoon. The file is just a plain text file, so you can open it up in TextEdit (or my preference BBEdit) if you want to check out the code. The hs folder contains some additional Hammerscript modules not written by me.
- We now need to move the downloaded init.lua and hs folder to ~/.hammerspoon/. The easiest way to do this is click Go > Go To Folder from the menubar in Finder (or press COMMAND + SHIFT + G from the desktop).
- You’ll then be presented with a dialogue box, where you need to type ~/.hammerspoon/.
- This will open the hidden Hammerspoon folder, where you need to drop in the previously downloaded init.lua file and hs folder.
- Now when you open Hammerspoon it should load the script, ready to rock and roll!
- You can now launch FCPX and see if it works by trying to match frame something (CONTROL + OPTION + COMMAND + F).
- If it doesn’t work for some reason, the Hammerspoon application has a Console (COMMAND + R) which displays any error messages. If things don’t work as expected, let us know in the comments below so that we can fix things up.
That’s it! Hopefully it works for you and you find it useful. If it doesn’t work for you, or if you have any ideas, comments or suggestions, feel free to leave them in the comments below. Happy Cutting!