diff --git a/app.py b/app.py index 90e96bd..cdaa832 100644 --- a/app.py +++ b/app.py @@ -128,6 +128,15 @@ class ZonzaApp(NSObject): def main(): validate_config(CONFIG) + # si l'Accessibilité n'est pas accordée, macOS affiche sa popup officielle + # (« Zonza souhaite contrôler cet ordinateur ») et ajoute l'app à la liste — + # bien plus fiable qu'un ajout manuel via « + » dans les Réglages. + from ApplicationServices import ( + AXIsProcessTrustedWithOptions, + kAXTrustedCheckOptionPrompt, + ) + trusted = AXIsProcessTrustedWithOptions({kAXTrustedCheckOptionPrompt: True}) + print(f"[diag] accessibilité accordée : {bool(trusted)}") app = NSApplication.sharedApplication() delegate = ZonzaApp.alloc().init() delegate.setup()