From b0a68b643c91b307c37e1b6ae2a9065f48c09167 Mon Sep 17 00:00:00 2001 From: AuroraWright Date: Sun, 11 Feb 2024 20:38:22 -0500 Subject: [PATCH] Put up with Sonoma being silly --- owocr/ocr.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/owocr/ocr.py b/owocr/ocr.py index 99c9f7b..1255ec2 100644 --- a/owocr/ocr.py +++ b/owocr/ocr.py @@ -303,6 +303,8 @@ class AppleLiveText: elif int(platform.mac_ver()[0].split('.')[0]) < 13: logger.warning('Apple Live Text is not supported on macOS older than Ventura/13.0!') else: + app_info = NSBundle.mainBundle().infoDictionary() + app_info['LSBackgroundOnly'] = '1' objc.loadBundle('VisionKit', globals(), '/System/Library/Frameworks/VisionKit.framework') objc.registerMetaDataForSelector( b'VKCImageAnalyzer', @@ -331,8 +333,6 @@ class AppleLiveText: } } ) - app_info = NSBundle.mainBundle().infoDictionary() - app_info['LSBackgroundOnly'] = '1' self.analyzer = VKCImageAnalyzer.alloc().init() self.available = True logger.info('Apple Live Text ready')