Privacy & Security on MacOS

Hello everyone!

I have an app, that interacts with another one, “clicking” and “dragging”. i know i need the Privacy & Security → Accessibility Enabled to my application interact with other apps.

But… is there a way to “force” my app to ask MacOS to enable it if it’s not?

and my app also call an apple script to do some things with another apps…
same question… how to force the macos to ask me to enable all i need?

i’m asking, because sometimes it not ask, and even worst, when debugging, it’s painful to keep enabling, restarting, etc…

any ideas?

By design, you cannot force this - those privileges specifically require user approval via the UI.

1 Like

You are using macOS, correct? You know how the security works. You need to check if what you want is available. If it’s not available then the user needs to enable the security (in most cases).

While it’s true, there are also cases where the OS won’t even ask the user and just deny the request. This happens randomly on all the Mac computers I’ve seen.
The usual trick in this case is to use the tccutil command in terminal to reset the fact that MacOS mistakenly thinks the user did deny the request.

1 Like

Sometimes the user just deny. They simply don’t know what that meant or did it in error like “let’s click anything to dismiss this” and deny. The app should detect such conditions and ask to the user to permit them (again).

Confirmed. GIMP des not allow a second chance (when you denied access)…

lol

and the error:

40:47: execution error: Not authorized to send Apple events to System Events. (-1743)

i don’t know how to force it to authorize. and it’s not an desktop app, its a “menu bar app”

What I have seen before is that the application that needs to be enabled figured out that it needs the user to accept that the application can access something. It displays a message asking the user if he agrees, and if so it displays the instructions and lauches the System app right at the correct page. Then it’s up to the uer to do what is needed.

Do you have the required entitlement file? Those are a PITA. And app is app on macOS except for console apps.

Do you have the required entitlement file?

no idea what is this!

lol

Then it’s time to learn. Some things don’t need an entitlement file like Full Disk Access but Automation and Contacts do. It’s also important to keep a built app around. Otherwise, macOS just deletes the entitlement when you kill the debug app.

Check out this project on how to learn the entitlements: GitHub - jo-tools/xojo2dmg: Xojo2DMG: CodeSign, DMG creation and Notarization (Post Build Script) . Or use AppWrapper from Sam Rowlands.

1 Like

thanks! i’ll check it!

Hello everyone!

After downloading the example of @Beatrix_Willius, i started digging and found this documentation on web, about infos.plist, from Apple.

Very useful!

and then this one:

Alex