{"id":6071,"library":"pyobjc-framework-automator","title":"PyObjC Framework Automator","description":"The `pyobjc-framework-automator` library provides Python wrappers for the macOS Automator framework, enabling Python applications to develop Automator actions and run workflows. It is part of the larger PyObjC bridge, which allows Python scripts to use and extend Objective-C class libraries, notably Apple's Cocoa. The current version is 12.1, released on 2025-11-14. PyObjC maintains an active development pace with several major and minor releases per year, often tied to macOS SDK updates and Python version support changes.","status":"active","version":"12.1","language":"en","source_language":"en","source_url":"https://github.com/ronaldoussoren/pyobjc","tags":["macOS","GUI","Automator","Objective-C","Cocoa","Automation"],"install":[{"cmd":"pip install pyobjc-framework-automator","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Core component for all PyObjC framework bindings.","package":"pyobjc-core"},{"reason":"Requires Python 3.10 or newer.","package":"python","optional":false}],"imports":[{"note":"Classes within the Automator framework are imported from the `Automator` package.","symbol":"AMWorkflow","correct":"from Automator import AMWorkflow"},{"note":"Classes within the Automator framework are imported from the `Automator` package.","symbol":"AMWorkflowController","correct":"from Automator import AMWorkflowController"}],"quickstart":{"code":"import Automator\nfrom Foundation import NSURL, NSArray # Foundation is often used with PyObjC frameworks\n\n# This example confirms that core Automator classes are accessible.\n# Actual execution of Automator workflows or creating complex actions\n# typically involves a full macOS application context (e.g., via py2app)\n# and specific workflow files.\n\nprint(f\"PyObjC Automator framework version: {Automator.__version__}\")\n\ntry:\n    # Check for the presence of key Automator classes\n    if hasattr(Automator, 'AMWorkflow'):\n        print(f\"Automator.AMWorkflow class found: {Automator.AMWorkflow}\")\n\n    if hasattr(Automator, 'AMWorkflowController'):\n        print(f\"Automator.AMWorkflowController class found: {Automator.AMWorkflowController}\")\n\n    # Example: Trying to get system-wide Automator actions (conceptual)\n    # Note: Requires a running Cocoa event loop in a real application\n    # or careful setup for console tools.\n    # For a simple check, we just confirm the class exists.\n    # AMAction.allActionsWithSearchFor_(\"PDF\") # Requires a real app context.\n\n    print(\"PyObjC Automator framework classes successfully accessed.\")\n\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\n    print(\"Ensure you are running on macOS and the pyobjc-framework-automator is installed.\")\n","lang":"python","description":"This quickstart demonstrates how to import the `Automator` framework and access its core classes. Running full Automator workflows or developing actions typically requires a complete macOS application context, often built with `py2app`, or a carefully configured console application. This example focuses on verifying framework access."},"warnings":[{"fix":"Upgrade to Python 3.10 or newer, or pin `pyobjc-framework-automator<12.0`.","message":"PyObjC 12.0 dropped support for Python 3.9. Projects targeting older Python versions must use an earlier PyObjC version.","severity":"breaking","affected_versions":">=12.0"},{"fix":"Upgrade to Python 3.9 or newer (for PyObjC < 12.0), or pin `pyobjc-framework-automator<11.0`.","message":"PyObjC 11.0 dropped support for Python 3.8. Projects targeting Python 3.8 must use an earlier PyObjC version.","severity":"breaking","affected_versions":">=11.0"},{"fix":"Review code that interacts with Objective-C `init` methods for potential changes in object lifecycle and reference counts.","message":"PyObjC 11.1 introduced alignment with `clang`'s Automatic Reference Counting (ARC) documentation for initializer methods. This change means methods in the 'init' family now correctly steal a reference to `self` and return a new reference, which may alter memory management behavior in existing code that relies on previous PyObjC reference counting for `init` methods.","severity":"breaking","affected_versions":">=11.1"},{"fix":"Remove dependencies on the \"IMServicePlugIn\" framework. There is no direct replacement for this deprecated Apple framework.","message":"The \"IMServicePlugIn\" framework bindings were removed in PyObjC 10.0 because the framework was deprecated in macOS 10.13 and completely removed in macOS 14. Code relying on these bindings will no longer function.","severity":"breaking","affected_versions":">=10.0"},{"fix":"Carefully manage `__init__` and `__new__` in Objective-C subclasses. If you rely on PyObjC's `__new__`, avoid implementing `__init__`. If implementing your own `__new__`, ensure `__init__` is correctly called, but be aware of limitations.","message":"There was a temporary breaking change in PyObjC 10.3 where calling `__init__` on subclasses of Objective-C classes was broken if the user also implemented `__new__`. While this was partially reverted in 10.3.1 to support `__init__` when a user-implemented `__new__` exists, users relying on PyObjC's provided `__new__` still cannot use `__init__`.","severity":"gotcha","affected_versions":">=10.3, <11.0"},{"fix":"If KVO is required for Python subclasses of `NSProxy`, consider alternative implementation strategies or explicit KVO management outside of the automatic behavior.","message":"As of PyObjC 12.1, Key-Value Observing (KVO) usage is automatically disabled for subclasses of `NSProxy` defined in Python. If your application relies on KVO with Python subclasses of `NSProxy`, this change will affect its behavior.","severity":"gotcha","affected_versions":">=12.1"}],"env_vars":null,"last_verified":"2026-04-14T00:00:00.000Z","next_check":"2026-07-13T00:00:00.000Z","problems":[]}