Freeze-frame automation with Auto Hotkey

I wrote an Auto Hotkey script to automate making a Freeze-frame still image quickly in a video. Please note, Auto Hotkey is for Windows only (as I understand it).
Here’s my quick YouTube tutorial:

How it works: It’s basically a sequence of standard Shotcut keyboard shortcuts.

NB Before starting, select the desired duration of the freeze-frame (eg 1 second or 5 seconds), using the JUMP feature (CTRL/J).

Explanation of how the AHK script works:

 numpad1::

Sets number-pad 1 as the first hotkey (trigger).

Send, +s

Splits all clips at the playhead (Shift/s) - note - this feature has only recently been added to Shotcut

 Send, ^+e

Exports frame (Ctrl/Shift/E)

 Send, Freeze-frame image
 Sleep, 100
 Send, {space}
 Sleep, 100
 Send,% clipboard		; Type the text saved in the clipboard

Clever! This types “Freeze-frame image 01” before saving the frame.
The next time you use the script it will save the frame as “Freeze-frame image 02”
(increasing incrementally).
The “sleep, 100” entries pause the AHK action by 100 milliseconds so as not to overwhelm Shotcut.

 send, {return}

Save the exported frame

send, !{PgDn}

Moves the playhead forward the number of seconds you chose (Jump) Ctrl/J.

Return

Ends the script.

NB for the next part to work, you must have the “Recents” panel showing, and the mouse co-ordinates shown in the script below (1720, 187) must be positioned so that the mouse clicks on the top-most entry.

If this is not the case, change the co-ordinates to make this happen, or alternatively the second part can easily done manually without pressing the Auto Hotkey hotkey.

  numpad2::

Makes number-pad 2 the hotkey (trigger)

 MouseClick, left, 1720, 187

Mouse clicks at these co-ordinates of your screen (selecting the top entry in the Recents panel)

  send {LButton 2}

Double-clicks

Return

End of script.

Then you drag the PNG to the timeline. Press O (out) if necessary, or drag out the clip if the gap is longer than 4 seconds. Or you could change the default duration of clips if you want to do a lot of these at a certain gap length.

Note that the Auto Hotkey “hotkeys” can be changed - for example CTRL/1 would be written as ^1:: instead of numpad1:: - just change in a text editor, say Notepad, and save.

Here’s my AHK script if anyone wants to use it. Just to add though I’m not responsible if anything goes wrong with using AHK scripts… however it’s very stable in my experience - in years of using it I’ve never had any issues with it.
Shotcut - FREEZE FRAME fully automated (two clicks - numpad 1 and 2) by JonRay.zip (1.1 KB)

3 Likes

That’s clever @jonray. :+1:

One question, if you don’t mind: I kind of remember that one million years ago, you mentioned that you didn’t use the latest version of Auto Hotkey. I don’t recall the exact reason, but I think it had something to do with it not being compatible with the script you were promoting at the moment…
Anyways, is it still the case? Older version or latest?

1 Like

Hi @MusicalBox - thank you.

You have a long memory. This was in the days when we all had a Woolly Mammoth as a pet. :smiley:

Good point, and an important one.
The AHK script I wrote is for version 1. Current version is v.2. V2 scripts are completely different from V1. I don’t understand V2 scripting (yet).
However, to my understanding if you are running V2, AHK will detect V1 scripts and run them with no problems.

Certainly works for me - I have V2.02 installed, but all my V1 scripts work fine.

auto hot key version

Thanks for bringing this up!

2 Likes