Sample Header Ad - 728x90

Using "screencapture" sometimes only takes screenshot of wallpaper

0 votes
2 answers
257 views
I have a working Python script that take screenshots of my single macOS display every minute using screencapture. The script essentially loops os.system(f'screencapture {output}.png'). Every once in a while, the screenshots suddenly start only showing my wallpaper. I know this isn't a screen recording permissions issue for Python, since the script works 99% of the time. Furthermore, once the buggy behavior starts, taking screenshots with screencapture myself on Terminal.app does the same thing. The bug never goes away by itself. The only fix I've found so far is to frustratingly restart my computer. Is there any documentation or fix for this behavior? Edit: To clarify, I am still able to take non-glitched screenshots with keyboard shortcuts like Shift + Command + 3.
Asked by antoine (103 rep)
Jul 13, 2024, 11:55 PM
Last activity: Mar 3, 2025, 05:01 PM