pasteboard-textinsertion

Inserts templated text into macOS apps via clipboard simulation, CGEvent typing, or Accessibility API with variable expansion and cursor placement.

1|Updated Feb 6, 2026
One-click install
npx skills add https://github.com/makgunay/claude-swift-skills --skill pasteboard-textinsertion
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pasteboard-textinsertion
Source: https://github.com/makgunay/claude-swift-skills/tree/main/pasteboard-textinsertion
Command: npx skills add https://github.com/makgunay/claude-swift-skills --skill pasteboard-textinsertion

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill automates the process of inserting text into other macOS applications, overcoming the limitations of simple copy-pasting and enabling dynamic text expansion.

Core Features & Use Cases

  • Multiple Insertion Methods: Supports clipboard simulation, character-by-character typing via CGEvent, and direct text field manipulation using the Accessibility API.
  • Variable Expansion: Inserts dynamic content like clipboard data, dates, usernames, and custom prompted variables.
  • Cursor Positioning: Automatically places the cursor after insertion based on a {{cursor}} placeholder.
  • Use Case: Create a text expander that, when triggered, inserts a pre-defined template into a document, filling in the current date and prompting the user for a specific project name.

Quick Start

Use the pasteboard-textinsertion skill to insert the text "Hello, {{username}}! Today is {{date}}." into the active application.

Frequently Asked Questions about pasteboard-textinsertion

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

FAQPage Schema
How do I automate text insertion into other macOS applications?

Automating text insertion into macOS applications is achieved through clipboard simulation, CGEvent keystroke typing, and Accessibility API direct access. These methods provide fallback mechanisms to reliably type or paste dynamic content into active text fields.

Can I use variable expansion to insert dynamic content like dates and usernames on macOS?

Variable expansion supports inserting dynamic content like dates, usernames, and clipboard data into macOS applications. You can create templates with placeholders for custom prompted variables, enabling automated text expansion with user-specific inputs.

What is the best way to programmatically type text into an active application using CGEvent?

Programmatically typing text using CGEvent involves character-by-character keystroke simulation to insert text into the active application. This method serves as a fallback mechanism for insertion reliability when clipboard simulation or Accessibility API access is insufficient.

Does macOS text insertion work with the Accessibility API for direct text field manipulation?

macOS text insertion works with the Accessibility API for direct text field manipulation, allowing automated input into other applications. This method bypasses clipboard simulation by directly accessing and modifying the target text fields.

How do I position the cursor automatically after inserting a text template into an application?

Cursor positioning after text insertion is handled automatically using a placeholder. You insert the cursor at a specific location by placing the placeholder within your text template, and the system positions the cursor there after the text is inserted.

Why does clipboard simulation fail for text insertion and how do I fix it?

Clipboard simulation for text insertion can fail due to application restrictions or clipboard access delays. Fallback mechanisms using CGEvent keystroke typing and Accessibility API direct access ensure reliable text insertion when simple clipboard pasting encounters limitations.