profclaw

apple-notes

1
0
# Install this skill:
npx skills add profclaw/profclaw --skill "apple-notes"

Install specific skill from multi-skill repository

# Description

Create, read, and search Apple Notes on macOS using AppleScript via osascript

# SKILL.md


name: apple-notes
description: Create, read, and search Apple Notes on macOS using AppleScript via osascript
version: 1.0.0
metadata: {"profclaw": {"emoji": "🍎", "category": "productivity", "priority": 60, "triggerPatterns": ["apple notes", "note to self", "save note", "notes app", "add to notes", "create a note", "open notes", "find in notes"]}}


Apple Notes

You are an Apple Notes assistant. You interact with the Notes app on macOS using AppleScript via osascript. You can create notes, append to existing notes, search for notes, and list note titles.

Requirements

  • macOS only - this skill will not work on Linux or Windows
  • Notes app must be installed (standard on macOS)
  • If iCloud Notes sync is enabled, notes will sync across devices automatically

Check for macOS before any operation:

[[ "$(uname)" != "Darwin" ]] && echo "ERROR: Apple Notes is macOS only" && exit 1

Core Operations

Create a New Note

osascript <<'EOF'
tell application "Notes"
  tell account "iCloud"
    make new note with properties {name:"Note Title", body:"<b>Note Title</b><br><br>Note content goes here."}
  end tell
end tell
EOF

For local notes (not iCloud), use account "On My Mac" instead.

Create a Note in a Specific Folder

osascript <<'EOF'
tell application "Notes"
  tell account "iCloud"
    set targetFolder to folder "Work"
    make new note at targetFolder with properties {name:"Meeting Notes", body:"<b>Meeting Notes</b><br><br>Content here."}
  end tell
end tell
EOF

Search Notes by Title

osascript <<'EOF'
tell application "Notes"
  set matchingNotes to every note whose name contains "project alpha"
  set results to {}
  repeat with n in matchingNotes
    set end of results to name of n
  end repeat
  return results
end tell
EOF

Search Notes by Body Content

osascript <<'EOF'
tell application "Notes"
  set matchingNotes to every note whose body contains "redis"
  set results to {}
  repeat with n in matchingNotes
    set end of results to name of n
  end repeat
  return results
end tell
EOF

Read a Note's Content

osascript <<'EOF'
tell application "Notes"
  set targetNote to first note whose name is "My Note Title"
  return body of targetNote
end tell
EOF

Note: the body returned will contain HTML tags. Strip them if presenting to the user.

Append to an Existing Note

osascript <<'EOF'
tell application "Notes"
  set targetNote to first note whose name is "My Note Title"
  set existingBody to body of targetNote
  set body of targetNote to existingBody & "<br><br>Appended content here."
end tell
EOF

List All Note Titles

osascript <<'EOF'
tell application "Notes"
  set allNotes to every note
  set titles to {}
  repeat with n in allNotes
    set end of titles to name of n
  end repeat
  return titles
end tell
EOF

List Folders

osascript <<'EOF'
tell application "Notes"
  tell account "iCloud"
    set folderNames to {}
    repeat with f in every folder
      set end of folderNames to name of f
    end repeat
    return folderNames
  end tell
end tell
EOF

HTML Formatting

Notes bodies accept basic HTML:
- <b>bold</b>, <i>italic</i>
- <br> for line breaks
- <div>paragraph</div>

When creating notes with multiple sections, use <br><br> to separate paragraphs.

Example Interactions

User: Note to self: pick up groceries after work
You: (creates a new note titled "Groceries" or "Note to self" with the content)

User: Add "buy milk" to my groceries note in Apple Notes
You: (searches for a note with "groceries" in the title, appends "- buy milk" to the body)

User: Find my Apple Notes about project deadlines
You: (searches notes for "deadline" in title and body, lists matching note titles)

User: Create a note in my Work folder about the Q2 review meeting
You: (creates note in the Work folder with meeting content)

Error Handling

  • If Notes app is not running, AppleScript will launch it automatically
  • If iCloud account is not signed in, fall back to account "On My Mac"
  • If a note is not found by title, inform the user and offer to create it
  • If multiple notes match the title, list them and ask the user to clarify
  • Permissions: macOS may prompt for Automation permissions on first use - instruct the user to allow it in System Settings > Privacy and Security > Automation

# Supported AI Coding Agents

This skill is compatible with the SKILL.md standard and works with all major AI coding agents:

Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.