PyObjC-framework-LaunchServices provides Python bindings for Apple's LaunchServices framework on macOS. It allows Python applications to interact with macOS features like launching applications, opening files, and querying file type information. Part of the larger PyObjC project, it is currently at version 12.1 and typically releases alongside new macOS SDK versions and Python major releases.
pip install pyobjc-framework-launchservicesVerified import paths — ran on the pinned version, not inferred.
This example demonstrates how to use `LSCopyAllApplicationURLs` to retrieve a list of all installed applications on macOS and print their file paths. It shows the basic pattern of importing symbols from PyObjC framework bindings.
Ensure your macOS version is compatible with the PyObjC version's SDK (check release notes, e.g., v12.1 built for 26.1 SDK). Consider using a Python virtual environment to manage dependencies for specific macOS targets.
Review Objective-C subclassing code, especially `alloc`/`init` sequences, to ensure correct object lifecycle management under the new ARC alignment. PyObjC now correctly models the reference ownership.
Ensure your class structure correctly handles object initialization. If you override `__new__`, ensure it returns an instance that PyObjC can initialize, or handle all necessary initialization within `__new__` itself. If on 10.3, upgrade to 10.3.1 or later if you rely on `__init__` with custom `__new__`.
Thoroughly test concurrent code involving PyObjC in free-threaded environments. Consider using traditional threading models (e.g., `threading` module with GIL) if issues arise, or stick to the main thread for Cocoa UI interactions.