apple-notes-data-handling
Installation
SKILL.md
Apple Notes Data Handling
Overview
Apple Notes stores note content as a restricted subset of HTML internally. The body() property in JXA returns this HTML, which includes <div>, <h1>-<h3>, <b>, <i>, <ul>, <li>, and Apple-specific classes for checklists and tables. Attachments (images, PDFs, sketches, scans) are embedded as <img> or object references but cannot be directly extracted via JXA — they require the attachments() property. Understanding these data formats is essential for building reliable import, export, and backup pipelines.
Prerequisites
- Written authorization for the accounts, folders, and note categories to be exported or transformed.
- An encrypted destination outside a shared directory, a retention limit, and a tested restore path.
- A conversion test corpus containing only synthetic notes; do not use the examples as proof that Apple Notes HTML is a stable public format.
Instructions
- Scope reads to named folders and minimize collected fields before invoking
osascript. - Write exports to a pre-created, owner-only directory and validate permissions before any data is emitted.
- Treat HTML and attachment metadata as untrusted content: sanitize before rendering, and never execute embedded links or markup.
- Hash or redact identifiers in operational logs; record only counts and completion state.