Back to directory

macapptree

A Python package that extracts the accessibility tree of macOS application windows as JSON, with an option to capture matching screenshots that highlight each UI element by type, for accessibility testing, UI automation and visual debugging.

macapptree

macapptree retrieves the accessibility hierarchy of one or more macOS applications as JSON, and can additionally capture a cropped screenshot of an application window alongside a labeled version that draws colored bounding boxes around UI elements by type. It can also capture the Dock and menu bar, or every currently visible running app at once.

The library exposes two main functions, one for extracting the tree alone and one that also produces the screenshots, and the same functionality is available from the command line for capturing multiple named applications or every open application in one pass. It installs through pip, requires macOS and Python 3.8 or newer, and is released under the MIT license.

More in Testing

See all 69
  • Canary

    runcanary.ai

    An independent testing service, backed by Y Combinator, that runs an application and tries to break every change an AI coding agent makes, reporting what would have reached production.

  • MoEWatch

    github.com

    A diagnostic and audit library for Mixture-of-Experts models in HuggingFace Transformers that instruments router modules to catch expert collapse, routing entropy collapse and load imbalance during training.

  • Mockwave

    github.com

    An open-source, multi-protocol mock server for HTTP, GraphQL, SOAP, and gRPC, with weighted traffic splitting, dynamic JavaScript responses, chaos-testing fault injection, and an MCP server so an AI assistant can generate mock rules directly.