{"library":"pyobjc-framework-applescriptkit","title":"PyObjC AppleScriptKit","description":"This library provides Python wrappers for the AppleScriptKit framework on macOS, allowing Python applications to embed, compile, and execute AppleScript code. It's part of the larger PyObjC project, which maintains a fairly active release cadence, typically releasing minor updates monthly/bi-monthly and major versions annually following macOS SDK updates. The current version is 12.1.","language":"python","status":"active","last_verified":"Sat May 16","install":{"commands":["pip install pyobjc-framework-applescriptkit"],"cli":null},"imports":["import AppleScriptKit","from AppleScriptKit import ASAppleScript"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import AppleScriptKit\nimport Foundation # For common Objective-C types like NSError\n\n# Define a simple AppleScript\nscript_source = '''\ndisplay dialog \"Hello from PyObjC AppleScriptKit!\"\nreturn \"Script executed successfully.\"\n'''\n\n# Create an ASAppleScript instance\n# Note: In PyObjC, None is used for 'nil' or 'NULL' in Objective-C\nerror_ptr = None # We'll pass None and check the returned tuple for errors\nscript = AppleScriptKit.ASAppleScript.alloc().initWithSource_error_(script_source, error_ptr)\n\nif script:\n    # Execute the script\n    result, error = script.executeAndReturnError_(error_ptr)\n    if error:\n        print(f\"Error executing script: {error.localizedDescription()}\")\n    elif result:\n        print(f\"Script result: {result.stringValue()}\")\n    else:\n        print(\"Script executed, no result or error reported.\")\nelse:\n    print(\"Failed to initialize ASAppleScript object.\")\n","lang":"python","description":"This quickstart demonstrates how to initialize and execute a simple AppleScript string using the `AppleScriptKit` framework. It shows the typical pattern of allocating an Objective-C object, calling an initializer, and handling potential errors.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-16","installed_version":null,"pypi_latest":"12.1","is_stale":null,"summary":{"python_range":"3.10–3.9","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"pyobjc-framework-applescriptkit","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"pyobjc-framework-applescriptkit","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":3.1,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"pyobjc-framework-applescriptkit","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"pyobjc-framework-applescriptkit","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":3.1,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"pyobjc-framework-applescriptkit","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"pyobjc-framework-applescriptkit","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":3,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"pyobjc-framework-applescriptkit","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"pyobjc-framework-applescriptkit","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":2.6,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"pyobjc-framework-applescriptkit","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"pyobjc-framework-applescriptkit","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":3.9,"import_time_s":null,"mem_mb":null,"disk_size":null}]}}