macpilot-dialog-handler

Handle macOS file dialogs (Open, Save, Print) with MacPilot. Navigate folders, select files, set filenames, and dismiss dialogs programmatically in any application.

3,807 stars

Best use case

macpilot-dialog-handler is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Handle macOS file dialogs (Open, Save, Print) with MacPilot. Navigate folders, select files, set filenames, and dismiss dialogs programmatically in any application.

Teams using macpilot-dialog-handler should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/macpilot-dialog-handler/SKILL.md --create-dirs "https://raw.githubusercontent.com/openclaw/skills/main/skills/adhikjoshi/macpilot/skills/macpilot-dialog-handler/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/macpilot-dialog-handler/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How macpilot-dialog-handler Compares

Feature / Agentmacpilot-dialog-handlerStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Handle macOS file dialogs (Open, Save, Print) with MacPilot. Navigate folders, select files, set filenames, and dismiss dialogs programmatically in any application.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# MacPilot Dialog Handler

Use MacPilot's dialog commands to interact with native macOS file dialogs (Open, Save As, Print, etc.) that appear in any application. Navigate to folders, select files, set filenames, and confirm or cancel dialogs.

## When to Use

Use this skill when:
- A file Open or Save dialog is showing and you need to navigate it
- You need to programmatically open or save files through native dialogs
- A modal dialog (alert, confirmation) needs to be dismissed
- You need to inspect what elements a dialog contains
- You need to automate file selection workflows

## Commands

### Detect Dialogs
```bash
macpilot dialog detect --json
# Returns: whether a modal dialog/sheet is present, its type, and owning app
```

### Inspect Dialog Elements
```bash
macpilot dialog inspect --json
# Returns: all interactive elements (buttons, text fields, lists) in the dialog
macpilot dialog inspect --depth 20 --json   # Deeper inspection
```

### Navigate to Folder
```bash
macpilot dialog navigate "/Users/me/Documents" --json
# Opens the Go To Folder sheet (Cmd+Shift+G), sets the path, presses Return
# Waits for navigation to complete
```

### List Files in Dialog
```bash
macpilot dialog list-files --json
# Returns: list of files/folders visible in the current dialog location
```

### Select a File
```bash
macpilot dialog select "myfile.txt" --json            # Select file (highlight only)
macpilot dialog select "myfile.txt" --confirm --json   # Select and confirm (Open/Save)
```

### Set Text Field (Filename)
```bash
macpilot dialog set-field "output.pdf" --json              # Set filename in Save dialog
macpilot dialog set-field "query" --label "Search" --json  # Set specific labeled field
macpilot dialog set-field "text" --focused --json          # Set currently focused field
```

### Click Dialog Button
```bash
macpilot dialog click-button "Save" --json
macpilot dialog click-button "Cancel" --json
macpilot dialog click-button "Open" --json
macpilot dialog click-button "Replace" --json
```

### Wait for Dialog
```bash
macpilot dialog wait-for --timeout 30 --json         # Wait for any dialog to appear
macpilot dialog wait-for --app "Safari" --json        # Wait for dialog in specific app
```

### Click Primary Button
```bash
macpilot dialog click-primary --json                 # Click default/primary button (OK, Allow, Open, etc.)
macpilot dialog click-primary --app "Finder" --json  # In specific app
```

### Dismiss Dialogs
```bash
macpilot dialog dismiss "OK" --json           # Dismiss by clicking named button
macpilot dialog auto-dismiss --json           # Auto-dismiss with safe defaults (Cancel/OK)
```

### Trigger File Open/Save
```bash
macpilot dialog file-open "/path/to/file.txt" --json   # Trigger Open and navigate
macpilot dialog file-save "/path/to/output.pdf" --json  # Trigger Save As and navigate
```

## Complete Workflows

### Save a File to Specific Location
```bash
# 1. Trigger Save dialog (Cmd+S or Cmd+Shift+S)
macpilot app focus "TextEdit"
macpilot keyboard key cmd+shift+s

# 2. Wait for dialog to appear
macpilot wait seconds 1

# 3. Navigate to target folder
macpilot dialog navigate "/Users/me/Desktop"

# 4. Set the filename
macpilot dialog set-field "report.txt"

# 5. Click Save
macpilot dialog click-button "Save"
```

### Open a Specific File
```bash
# 1. Trigger Open dialog
macpilot app focus "TextEdit"
macpilot keyboard key cmd+o

# 2. Wait for dialog
macpilot wait seconds 1

# 3. Navigate and select
macpilot dialog navigate "/Users/me/Documents"
macpilot wait seconds 1
macpilot dialog select "readme.md" --confirm
```

### Handle "Replace Existing File" Confirmation
```bash
macpilot dialog click-button "Save"
macpilot wait seconds 0.5
# Check if a confirmation dialog appeared
macpilot dialog detect --json
# If yes, click Replace
macpilot dialog click-button "Replace"
```

### Inspect an Unknown Dialog
```bash
# First, see what dialog is present
macpilot dialog detect --json

# Then inspect all its interactive elements
macpilot dialog inspect --json

# Now you know what buttons and fields are available
```

### One-Shot File Open
```bash
# Combines triggering the open dialog, navigating, and selecting
macpilot dialog file-open "/Users/me/Documents/report.pdf"
```

## Critical Patterns

1. **Wait after triggering dialogs**: Always `macpilot wait seconds 1` after `cmd+o` or `cmd+s` to let the dialog fully appear before interacting.

2. **Navigate before selecting**: File dialogs open in the last-used directory. Always `dialog navigate` to the correct folder first.

3. **Dialog owns focus**: When a dialog is open, the dialog's owning app must be active. MacPilot's dialog commands handle this automatically by scanning all apps for dialogs.

4. **Use inspect for unknown dialogs**: If you're unsure what elements a dialog has, run `dialog inspect --json` first to see all available buttons, fields, and controls.

5. **Handle cascading dialogs**: Save operations may trigger "Replace?" or "Format?" confirmation dialogs. Always check with `dialog detect` after clicking Save.

6. **set-field vs keyboard type**: Use `dialog set-field` instead of `keyboard type` for entering filenames - it directly sets the AX value, which is more reliable than simulating keystrokes.

7. **wait-for + click-primary**: For automated workflows, use `dialog wait-for` to detect when a dialog appears, then `dialog click-primary` to accept the default action. The primary button check looks for `AXDefaultButton` first, then falls back to common labels (OK, Allow, Open, Save, Continue, Yes, Done, Confirm).

Related Skills

sales-dialogue

3807
from openclaw/skills

Generate persuasive sales scripts, competitive comparison talking points, and real-time response recommendations

Workflow & Productivity

aibrary-podcast-dialogue

3807
from openclaw/skills

[Aibrary] Generate a book dialogue podcast script with two speakers — a host and a guest expert — discussing the book's ideas in a natural conversation. Use when the user wants to create a conversational podcast about a book, turn a book into a two-person discussion, or generate a dialogue-style podcast script. Different from aibrary-podcast-summary (single narrator) and aibrary-podcast-ideatwin (debate format).

deep-dialogue

3807
from openclaw/skills

Structured framework for deep philosophical and psychological conversations. Use when exploring personal issues, existential questions, meaning-making, belief examination, or psychological patterns. Guides conversations through clarification, framework application, dialectical challenge, and synthesis. Integrates Stoicism, Existentialism, Socratic Method, CBT, ACT, and Jungian psychology.

macpilot-window-manager

3807
from openclaw/skills

Manage macOS windows with MacPilot. List, move, resize, snap, minimize, fullscreen, and arrange application windows. Supports multi-display and Spaces.

macpilot-ui-inspector

3807
from openclaw/skills

Inspect and interact with macOS UI elements using MacPilot accessibility APIs. Find buttons, text fields, labels, and other elements by role, label, or position, then click, read, or modify them.

macpilot-screenshot-ocr

3807
from openclaw/skills

Capture screenshots and extract text via OCR using MacPilot. Take full-screen, region, or window screenshots, and recognize text in images or screen areas with multi-language support.

macpilot-automation

3807
from openclaw/skills

Core macOS automation skill using MacPilot CLI. Enables Claude Code to control apps, type text, click elements, run shell commands, and automate workflows on macOS via the `macpilot` command.

MacPilot Skills

3807
from openclaw/skills

Agent skills for [MacPilot](https://github.com/adhikjoshi/macpilot) — a CLI tool for macOS automation via Accessibility APIs.

Telegram Marketing Audit Command Handler Skill

3807
from openclaw/skills

## Purpose

Objection Handler

3807
from openclaw/skills

Handles sales objections with proven response frameworks

---

3807
from openclaw/skills

name: article-factory-wechat

Content & Documentation

humanizer

3807
from openclaw/skills

Remove signs of AI-generated writing from text. Use when editing or reviewing text to make it sound more natural and human-written. Based on Wikipedia's comprehensive "Signs of AI writing" guide. Detects and fixes patterns including: inflated symbolism, promotional language, superficial -ing analyses, vague attributions, em dash overuse, rule of three, AI vocabulary words, negative parallelisms, and excessive conjunctive phrases.

Content & Documentation