HomeAppleCan I cease macOS asking for display screen recording permission whereas utilizing...

Can I cease macOS asking for display screen recording permission whereas utilizing mss.mss() in a python script?


I’m attempting to make use of mss to seize a portion of my display screen utilizing the next code:

import mss
import cv2
import numpy as np

monitor_region = {
    "high": 810,
    "left": 1070,
    "width": 660,
    "peak": 300
}


def get_frame(display_frame=False):
    with mss.mss() as sct:
        # Seize a single body
        img = sct.seize(monitor_region)

        # Convert to NumPy array and show
        body = np.array(img)
        # print(body)
        # print("body dim = ", body.form)

        if display_frame:
            cv2.imshow("Captured Area", body)
            cv2.waitKey(0)
            cv2.destroyAllWindows()

When working, my mac retains prompting for permission and
I’ve to click on permit for each request.

Can I cease macOS asking for display screen recording permission whereas utilizing mss.mss() in a python script?

Sadly, this is not only a one-time factor, it occurs for each screenshot request I make. This isn’t possible when I’m making a number of requests. Therefore, I’m in search of a technique to disable this safety verify.

I’ve allowed terminal full entry to the disk, and to display screen and audio recording in my system settings. This nonetheless did not work so I’m at present utilizing pyautogui to routinely permit this, however that is nonetheless sluggish (takes ~0.2 seconds to do away with) for my utility.

I’m anticipating an answer to information me to disable the above safety verify.

Is it potential to eradicate additional requests?

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments