Feature(?): Grab only app's frame
General information:
- OS name: macOS Catalina
- OS version: 10.15.4
- Python version: 3.7.7
- MSS version: last
Description
Is there a way to capture only the frame of a specific app window? I mean with built-in macOS screencapture, I can do something like this to get a screenshot of a particular app:
os.system("screencapture {options} -l {window} {filename}")
where {window} represents the windowID of the app, in my case QuickTime Player app ID (obtained from Quartz).
Being able to specify which app I want to take the screenshot of would result in a more flexibility, as I can move the app window wherever I want and I don't need to set any kind of boundary (top,left,width,height).
cheers, mate!
Hey,
Yes, it would be cool to have it! Another thing on my TODO list ;)
You can write a while-loop, which gets the rectangle of the app via his PID - this rectangle you can set as argument on the mss.grab function.
I just wrote a solution for this request here #180 and it is indeed possible. I am currently attempting to edit this library to provide the function, but I am not sure how far I will progress on my own :P