agentsclimarketplace

Apple notes common errors

Skill jeremylongshore/claude-code-plugins-plus-skills/plugins/saas-packs/apple-notes-pack/skills/apple-notes-common-errors

425 plugins, 2,810 skills, 200 agents for Claude Code. Open-source marketplace at tonsofskills.com with the ccpi CLI package manager.

Install
npx -y skills add jeremylongshore/claude-code-plugins-plus-skills --skill apple-notes-common-errors

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

What its author says it does

Copied from the file, not written here

'Diagnose and fix common Apple Notes automation errors.

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

5.0 KB, as published. Nobody here has run it

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

ErrorCodeRoot CauseFix
Not authorized to send Apple events-1743TCC denied automation permissionSystem Settings > Privacy > Automation > enable your app
AppleEvent timed out-1712Notes.app busy, hung, or not runningApplication("Notes").activate(); increase timeout with delay
Can't get application "Notes"-2700Notes.app not installed or renamedVerify with mdfind "kMDItemCFBundleIdentifier == com.apple.Notes"
Can't get folder-1728Folder name mismatch (case-sensitive)List folders first: Notes.defaultAccount.folders().map(f => f.name())
Connection is invalid-609Notes.app crashed mid-operationkillall Notes; sleep 2; open -a Notes; sleep 3
User canceled-128Security dialog dismissed or timed outRe-run and click Allow; or pre-grant via MDM profile
Can't make Note-10000Invalid HTML in note bodyValidate HTML; strip unsupported tags before creating
Application isn't running-600App quit between callsWrap in retry with Application("Notes").activate() first

Diagnostic Script

#!/bin/bash
echo "=== Apple Notes Diagnostics ==="
echo -n "macOS version: "; sw_vers -productVersion
echo -n "Notes.app running: "; pgrep -x Notes > /dev/null && echo "Yes" || echo "No"
echo -n "Notes.app path: "; mdfind "kMDItemCFBundleIdentifier == com.apple.Notes" 2>/dev/null | head -1
echo -n "Note count: "
osascript -l JavaScript -e 'Application("Notes").defaultAccount.notes.length' 2>/dev/null || echo "ERROR — check TCC"
echo -n "Folder count: "
osascript -l JavaScript -e 'Application("Notes").defaultAccount.folders.length' 2>/dev/null || echo "ERROR"
echo -n "Accounts: "
osascript -l JavaScript -e 'Application("Notes").accounts().map(a => a.name()).join(", ")' 2>/dev/null || echo "ERROR"
echo -n "iCloud status: "
defaults read MobileMeAccounts Accounts 2>/dev/null | grep -c AccountID || echo "No iCloud"
echo "=== TCC Automation Entries ==="
sqlite3 ~/Library/Application\ Support/com.apple.TCC/TCC.db \
  "SELECT client, allowed FROM access WHERE service='kTCCServiceAppleEvents';" 2>/dev/null || echo "Cannot read TCC.db (SIP)"
echo "=== Done ==="

Common Fixes

# Reset TCC automation permissions (triggers fresh prompts)
tccutil reset AppleEvents

# Force quit and restart Notes with delay for launch
killall Notes 2>/dev/null; sleep 2; open -a Notes; sleep 3

# Verify Notes is responsive after restart
osascript -l JavaScript -e 'Application("Notes").defaultAccount.notes.length'

# Force iCloud sync restart
killall bird 2>/dev/null; killall cloudd 2>/dev/null; sleep 5

# Check for stuck iCloud sync
brctl status com.apple.Notes 2>/dev/null || echo "brctl not available"

Retry Wrapper for Transient Failures

// Retry pattern for -609, -600, -1712 errors
function withRetry(fn, maxAttempts = 3) {
  for (let i = 0; i < maxAttempts; i++) {
    try { return fn(); }
    catch (e) {
      if (i === maxAttempts - 1) throw e;
      Application("Notes").activate();
      delay(2);
    }
  }
}

// Usage
const count = withRetry(() => Application("Notes").defaultAccount.notes.length);

Error Handling

IssueCauseSolution
Errors persist after TCC resetApp-specific permission cachedRestart Terminal/IDE after tccutil reset
iCloud notes show stale dataSync daemon pausedkillall bird && killall cloudd to force resync
Sandbox prevents database readSIP protects TCC.dbUse osascript to test access instead of direct DB query
Script works manually, fails from cronCron has no TCC contextUse launchd with AssociatedBundleIdentifiers instead

Resources

Next Steps

For incident response when errors cascade, see apple-notes-incident-runbook. For TCC and security hardening, see apple-notes-security-basics.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.