macos-accessibility

Inspect and control macOS UI elements via AXUIElement with permission checks.

3|1|Updated Dec 3, 2025
One-click install
npx skills add https://github.com/Probably-Group/Dev-AID --skill macos-accessibility-probably-group
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: macos-accessibility
Source: https://github.com/Probably-Group/Dev-AID/tree/main/.dev-aid/skills/expert/macos-accessibility
Command: npx skills add https://github.com/Probably-Group/Dev-AID --skill macos-accessibility-probably-group

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill solves reliable macOS UI automation when you need to interact with app controls through Accessibility APIs (AXUIElement), reducing flaky tests caused by permission issues, stale element references, and missing state validation.

Core Features & Use Cases

  • Accessibility Permission (TCC) Validation: Ensures automation only proceeds after checking Accessibility trust to avoid silent failures and reduce unsafe permission misuse.
  • AXUIElement Safety & Resilient Element Resolution: Prevents crashes and misclicks by avoiding cached/stale references and by validating attributes before use.
  • Secure, Bounded UI Traversal & Safe Actions: Adds depth/result/time limits for UI hierarchy search and verifies element enabled/visible state before performing actions, helping prevent unexpected behavior.
  • Observer Lifecycle Management (when needed): Uses properly cleaned-up AXObserver patterns to avoid leaks during event monitoring.

Quick Start

Use the macos-accessibility skill when you want your AI-assisted agent or test tool to inspect and safely click macOS UI elements using AXUIElement after verifying Accessibility permission has been granted.

Frequently Asked Questions about macos-accessibility

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate macOS UI testing safely using AXUIElement without permission errors?

macOS UI automation via AXUIElement requires checking TCC Accessibility permissions before interacting with app elements to prevent silent failures. Validating element attributes and enabled states before executing actions ensures safe, reliable control over the user interface.

Why do my macOS accessibility automation scripts crash when traversing the UI hierarchy?

UI hierarchy traversal crashes often stem from unbounded searches or stale AXUIElement references. Applying depth and time limits during inspection, alongside validating element visibility before performing actions, prevents misclicks and unexpected application behavior.

How do I handle AXError and AXObserver cleanup during macOS UI automation?

Handling AXError explicitly and managing the AXObserver lifecycle prevents memory leaks and execution faults during event monitoring. Properly cleaning up observers after UI actions ensures your macOS accessibility automation remains stable and secure.

Do I need TCC Accessibility permission to inspect and click macOS app elements?

Yes, TCC Accessibility permission is strictly required to inspect and control macOS app elements via AXUIElement. Validating this trust status before attempting UI automation avoids unsafe permission misuse and reduces flaky test execution.

What is the best way to prevent stale element references in macOS UI automation?

Preventing stale AXUIElement references requires avoiding cached references and validating element attributes immediately before use. Bounding your UI hierarchy traversal with result and time limits further secures element resolution during macOS system control.

Can I use accessibility APIs to automate UI testing for volatile macOS interfaces?

Yes, accessibility APIs can automate UI testing for volatile macOS interfaces by applying bounded hierarchy traversal and explicit AXError handling. Validating element state before actions ensures robust automation even when the UI tree changes dynamically.