1

I start screen capturing on Mac using cmd-shift-5. I would like a way to programmatically stop the screen capture (or alternatively, to flush to screen capture so far to disk).

The reason I'd like this is I'd like to start processing the first minute of screen capture while I continue recording additional footage. I already have ways of programmatically starting a screen capture (1. programmatically sending keyboard inputs to mimic cmd-shift-5 ENTER; or 2. the screencapture command line tool, though I can't seem to get the command line tool to record audio, just video, and the audio's important too), but not of programmatically stopping the capture.

There doesn't even seem to be a keyboard shortcut for stopping the capture; only a button on the touchbar. Some options I've considered are 1) trying to find a way to programmatically use the touchbar, or 2) a combination of programmatic keyboard and mouse movements (cmd-shift-5, then clicking the stop recording button.)

A better approach would be appreciated!

AVANISH RAJBHAR
  • 527
  • 3
  • 9
David
  • 53
  • 5
  • 1
    Option (2) is working fine for me for now. I'm using a combination of the Python "keyboard" module and Quartz for mouse movement as suggested in https://stackoverflow.com/a/8202674/553681 and together I'm able to programmatically start and stop screen captures, albeit with small delays. – David Feb 29 '20 at 06:47
  • Had the same question! Thanks a lot for sharing how you solved it! – Anatol Feb 04 '21 at 20:32

0 Answers0