Is there anything to make a one off screenshot? like cmd+shift+3. But with code?
There is ScreenCaptureKit - but it seems to be more for video / audio streams. I thought of trying to get the first frame from the video stream. But it seems to be rather a complex workaround for a simple problem.
You could use SCScreenshotManager captureImage(contentFilter:configuration:completionHandler:)
API to capture a single frame from a stream as an image if that's what you need.