SKILL.md
Apple Notes Common Errors
Overview
Apple Notes automation errors fall into three categories: TCC permission denials from macOS security, AppleEvent communication failures between your script and Notes.app, and iCloud sync issues that cause data inconsistency. Unlike REST APIs that return HTTP status codes, Apple Events use negative OSStatus codes. This guide covers every error you are likely to encounter when automating Notes via JXA or osascript, with tested fixes for each.
Error Reference
| Error | Code | Root Cause | Fix |
|---|---|---|---|
| Not authorized to send Apple events | -1743 | TCC denied automation permission | System Settings > Privacy > Automation > enable your app |
| AppleEvent timed out | -1712 | Notes.app busy, hung, or not running | Application("Notes").activate(); increase timeout with delay |
| Can't get application "Notes" | -2700 | Notes.app not installed or renamed | Verify with mdfind "kMDItemCFBundleIdentifier == com.apple.Notes" |
| Can't get folder | -1728 | Folder name mismatch (case-sensitive) | List folders first: Notes.defaultAccount.folders().map(f => f.name()) |
| Connection is invalid | -609 | Notes.app crashed mid-operation | killall Notes; sleep 2; open -a Notes; sleep 3 |
| User canceled | -128 | Security dialog dismissed or timed out | Re-run and click Allow; or pre-grant via MDM profile |
| Can't make Note | -10000 | Invalid HTML in note body | Validate HTML; strip unsupported tags before creating |
