In this post I’ll be adding onto last week’s tutorial on automation using the program Keyboard Maestro. If you’ve never used Keyboard Maestro before, read over that post first.
In post production we’re often stuck repeating the same set of keystrokes dozens or hundreds of times. For example, when I prep an audio turnover, I repeatedly hammer the combo Mark clip – Match Frame – Overwrite to create a Sync AAF. It’s mind-numbing stuff.
In this post, I’ll teach you to create a macro that uses variables to do your dirty work for you. I’ll be using Mark Clip – Match Frame – Overwrite as the example, but it will work with any combination of keystrokes.
You’ll type in the number of repeats, and Keyboard Maestro will grind away while you sip a coffee.
I don’t have time for this. Can’t I just download the macros you’ve already built? Yes! I’ll upload small macros for simple tasks, including the macros in this article, to this page.
However, if you want to unlock the full potential of macros, you’ll need to learn how to write them yourself. If you follow me along in these guides, you’ll understand how to build your own complex macros tailored for your own projects and workflows.
Basically, let me be your Bob Ross for post-production automation.
What are Variables?
Variables are user-defined pieces of data that can be set and recalled within your macros. They can be set by user input, calculations, the system clipboard, or many other sources.
That may sound complicated, but don’t worry – it basically works like copy/paste.
In our macro, we’ll start with a user input dialogue box for a variable called RepeatQuantity. Each time you run the macro, this dialogue will pop up and ask you for a number.
If your timeline has 284 clips, you’ll set the variable to 284 – and then the macro will repeat your keystroke combo 284 times. Simple enough.
Building the Macro
This macro’s concepts are similar between Premiere and Avid, but there are some subtle differences in the way each program works. I’ll highlight Premiere-specific steps in red, and Avid in purple.
Let’s dive in.
Step 1: Create a RepeatQuantity Dialogue Box
Create a new macro, and use the “+” button to bring up the full list of actions. You want the one called Prompt for User Input.
As seen in the screenshot, type RepeatQuantity into the variable field. (You could name it anything, but RepeatQuantity has a nice ring to it.) Add an explanation to the prompt text.
Step 2: Activate Your Editing Software
Since you’ll activate this macro by pressing Run within Keyboard Maestro, we need to add a step to switch back into your editing software.
Hit “+” again, and add Activate a Specific Application. Set this to your NLE.
Adobe installs each annual version of Premiere as a different program. When you update Premiere to a new year, you’ll have to update all macros that point to it.
Step 3: Set Up a Repeat Container
Add a new action: Repeat. This creates a container action that will contain our keystroke actions.
By default, the repeat box uses a static number. However, if we type in RepeatQuantity, Repeat action will recall the variable we define when running the macro – like 284.
Step 4: Input the Keystroke Combo
Now, enter the specific keyboard combo you want to repeat – in our case, mark clip-match frame-overwrite.
Add the Type a Keystroke action four times, and nest them within the Repeat container. Enter the keystrokes for the below actions, specific to your personal keyboard settings:
- Mark clip
- Match frame
- Focus timeline window (Premiere) / Toggle Source/Record Mode (Avid)
- Pause .5 seconds
Pauses are very important because they let your NLE keep up with the macro’s keyboard input. If your computer is lagging while using the macro, increase the pause time.
You can never have too many pauses.
Step 5: Finish Up with a Success Sound
I like to have Keyboard Maestro play a sound at the end of a long macro so I know when it’s finished – even if I’m in another room.
Add the Play Sound action. I like “Funk,” but choose whatever speaks to you.
Last, right-click on this action and press Add to Favorites. Name it Play Success Sound. Going forward, you’ll be able to easily add your sound to the end of all your long macros.
Voilá! You can now run the macro. Sit back, grab a coffee, and watch your computer do your work for you.
This macro is very simple, so there’s not much room for error.
- If you’re running Premiere and the macro is frantically focusing on incorrect timelines, you’ve likely enabled Set focus on the timeline when performing Insert/Overwrite edits in your Timeline Preferences. Either disable the setting, or delete the Focus Timeline Panel action in Keyboard Maestro.
- If your computer lags when match-framing to new footage, add a pause after the match-frame keystroke. I say it often: you can never have too many pauses.
Did your macro work, or did anything give you trouble? Please leave a comment with your successes and frustrations. I’ll help out however I can.
I’ll be posting more tutorials on using Keyboard Maestro to burn through post-production work, so get on my mailing list for updates.