← Prompts
Skill / Understand Agent Rules (steipete)

Reusable AppleScript patterns for automated screenshot capture for documentation and testing

Reusable AppleScript patterns for automated screenshot capture for documentation and testing

# Screenshot Automation Guide

This guide provides reusable AppleScript patterns for taking automated screenshots of applications, particularly useful for documentation, testing, and visual verification.

## Core Concepts

### Application Identification

Applications can be identified through multiple methods:
- **Bundle ID**: Most reliable for packaged apps (e.g., `com.company.AppName`)
- **Process Name**: May differ from app name (e.g., "Electron" for dev builds)
- **Absolute Path**: Most reliable for development builds and non-standard locations

### Basic Screenshot Script

```applescript
-- Script to take an unattended screenshot of an app window
-- Set appPath to the full path of the application

try
    -- Set this to the full path of the application
    set appPath to "/Applications/YourApp.app"
    
    -- Generate timestamp for unique filename
    set currentDate to do shell script "date '+%Y-%m-%d_%H-%M-%S'"

Sign in to view the full prompt.

Sign In

Classification

Skill Capability with explicit trigger pattern
Skill Understand
Explain or analyze
Scope Project
This codebase
Manual Manually placed / Persistent