apple-text-pasteboard

Sanitize pasted content and custom pasteboard types in Apple text editors.

Updated Mar 19, 2026
One-click install
npx skills add https://github.com/sitapix/apple-text --skill apple-text-pasteboard
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: apple-text-pasteboard
Source: https://github.com/sitapix/apple-text/tree/main/skills/apple-text-pasteboard
Command: npx skills add https://github.com/sitapix/apple-text --skill apple-text-pasteboard

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Copy, cut, and paste operations in Apple text editors often carry unwanted formatting, behave inconsistently across components, and complicate image pastes. This Skill provides guidance to sanitize pasted content, define and read custom pasteboard types, and integrate paste handling with UITextView and NSTextView for predictable, clean editing experiences.

Core Features & Use Cases

  • Rich-text sanitization: strip or preserve select attributes when pasting to maintain visual consistency.
  • Custom pasteboard types: define internal formats to exchange data reliably between app components.
  • Image and attachment handling: paste images as NSTextAttachment and scale to fit the text container.
  • NSItemProvider integration: support modern paste/drag/drop flows across iOS and macOS.
  • Use Case: integrate sanitized paste into a note-taking app or code editor to avoid unexpected formatting.

Quick Start

Describe how to implement sanitized paste handling in a UITextView for a notes app.

Frequently Asked Questions about apple-text-pasteboard

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

FAQPage Schema
How do I sanitize rich-text formatting when pasting into UITextView or NSTextView?

To sanitize rich-text formatting during paste in UITextView or NSTextView, you intercept the paste operation to strip unwanted attributes from the attributed string, ensuring consistent visual styling. This process standardizes pasted content for predictable text editing.

How does NSItemProvider integration work for custom pasteboard types in iOS and macOS?

NSItemProvider integration for custom pasteboard types allows your app to define and read internal data formats reliably. It supports modern paste, drag, and drop flows across iOS and macOS by securely exchanging custom data between app components.

Can I paste images as NSTextAttachment and scale them to fit the text container?

Yes, you can paste images as NSTextAttachment and scale them to fit the text container. This image and attachment handling approach ensures pasted media integrates smoothly without disrupting the surrounding text flow or layout.

What is the best way to handle undo-safe editing when modifying text storage during a paste operation?

The best way to handle undo-safe editing when modifying text storage is to wrap paste handling operations within undo grouping APIs. This ensures that sanitized paste actions can be cleanly undone or redone by the user.

Why does pasted content carry unwanted formatting in Apple text editors and how can I standardize it?

Pasted content carries unwanted formatting in Apple text editors because clipboard data often retains source attributes. You standardize this by implementing rich-text sanitization to strip or preserve select attributes, ensuring clean and consistent editing behavior.