{"id":26727,"library":"appscript","title":"appscript","description":"appscript is a Python library that allows you to control AppleScriptable applications from Python, providing an object-oriented API to bridge Python and AppleScript (via the Apple Event Manager). The current version is 1.4.0, which was released in 2015 and has been in maintenance mode since macOS 10.15 (Catalina) due to significant changes in macOS's Apple Event architecture.","status":"active","version":"1.4.0","language":"python","source_language":"en","source_url":"https://github.com/abarnert/appscript","tags":["macos","applescript","osascript","automation","deprecated"],"install":[{"cmd":"pip install appscript","lang":"bash","label":"Install via pip"}],"dependencies":[],"imports":[{"note":"app is the main entry point; importing the module directly does not give you the app function.","wrong":"import appscript","symbol":"app","correct":"from appscript import app"},{"note":"k is a constant for keyword parameters; it is not named 'key'.","wrong":"from appscript import key as k","symbol":"k","correct":"from appscript import k"}],"quickstart":{"code":"from appscript import app, k\n\n# Get the current Finder\nfinder = app('Finder')\n\n# List files on desktop\nfor item in finder.desktop.files():\n    print(item.name())","lang":"python","description":"Control the Finder to list files on the desktop."},"warnings":[{"fix":"Ensure your application is granted automation permissions in System Preferences. For headless or script use, consider using osascript or PyObjC alternative.","message":"appscript is heavily dependent on Apple's Open Scripting Architecture (OSA). Starting with macOS 10.15 (Catalina), Apple introduced stricter sandboxing and deprecated the use of inter-process Apple Events for non-sandboxed apps. As a result, many scripts may fail or require explicit user permissions via System Preferences > Security & Privacy > Automation.","severity":"gotcha","affected_versions":"macOS >= 10.15"},{"fix":"Use a native arm64 Python interpreter (e.g., from python.org or Homebrew). Check with 'python -c \"import platform; print(platform.machine())\"'.","message":"appscript is not compatible with macOS Big Sur (11.0) and later on Apple Silicon (M1/M2) when running Python under Rosetta 2. Python must be native (arm64) or the library may crash or behave unpredictably.","severity":"gotcha","affected_versions":"macOS >= 11.0 (Apple Silicon)"},{"fix":"Consider migrating to PyObjC's ScriptingBridge or using osascript via subprocess for new projects.","message":"The appscript project is effectively in maintenance mode. The last release was in 2015, and there are known issues with modern macOS versions. No future updates are expected.","severity":"deprecated","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use 'from appscript import app' instead of 'import appscript'.","cause":"Importing the top-level module instead of the specific submodule.","error":"AttributeError: module 'appscript' has no attribute 'app'"},{"fix":"Ensure the target application is running and that Python (or your script) has been granted automation permissions under System Preferences > Security & Privacy > Automation.","cause":"This error (-10004) indicates a timeout or failure to communicate with the target application. Often due to permissions or app not running.","error":"appscript.reference.CommandError:  ...  (-10004)"},{"fix":"Install with 'pip install appscript'. Note that appscript is only available on macOS.","cause":"The appscript package is not installed or not in the current Python environment.","error":"ModuleNotFoundError: No module named 'appscript'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}