Skip to content
OpenSmartRoute
Skillv1.0.0

apple-notes-hello-world

Create, read, and list Apple Notes using JXA and AppleScript. Use when learning Notes automation, creating your first automated note, or testing read/write access to Apple Notes from scripts. Trigger:

by jeremylongshore(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from jeremylongshore/tons-of-skills-marketplace (skills/.curated/apple-notes-hello-world/SKILL.md). Install upstream with npx skills add jeremylongshore/tons-of-skills-marketplace --skill apple-notes-hello-world. Copyright stays with the author (MIT).

Apple Notes Hello World

Overview

Create, read, search, and delete Apple Notes using JXA (JavaScript for Automation) via osascript. All examples work from the command line on macOS.

Prerequisites

  • Completed apple-notes-install-auth (permissions granted)
  • macOS with Notes.app

Instructions

Step 1: Create a Note

# JXA: Create a note in the default folder
osascript -l JavaScript -e '
  const Notes = Application("Notes");
  const defaultFolder = Notes.defaultAccount.folders[0];
  const newNote = Notes.Note({
    name: "Hello from Automation",
    body: "<h1>Hello World</h1><p>This note was created via JXA at " + new Date().toISOString() + "</p>"
  });
  defaultFolder.notes.push(newNote);
  newNote.id();
'

# AppleScript equivalent:
osascript -e '
  tell application "Notes"
    tell account "iCloud"
      make new note at folder "Notes" with properties {name:"Hello AppleScript", body:"<p>Created via AppleScript</p>"}
    end tell
  end tell
'

Step 2: List All Notes

# List notes with title and creation date
osascript -l JavaScript -e '
  const Notes = Application("Notes");
  const notes = Notes.defaultAccount.notes();
  notes.slice(0, 10).map(n =>
    `${n.name()} | Created: ${n.creationDate().toISOString().split("T")[0]}`
  ).join("\n");
'

Step 3: Read a Note's Content

# Read note body (returns HTML)
osascript -l JavaScript -e '
  const Notes = Application("Notes");
  const notes = Notes.defaultAccount.notes();
  const target = notes.find(n => n.name() === "Hello from Automation");
  if (target) {
    `Title: ${target.name()}\nBody: ${target.body()}\nModified: ${target.modificationDate()}`;
  } else {
    "Note not found";
  }
'

Step 4: Search Notes

# Search by keyword in note name
osascript -l JavaScript -e '
  const Notes = Application("Notes");
  const query = "Hello";
  const results = Notes.defaultAccount.notes().filter(n =>
    n.name().toLowerCase().includes(query.toLowerCase())
  );
  results.map(n => n.name()).join("\n") || "No results";
'

Step 5: Create Note in Specific Folder

# Create a folder and add a note to it
osascript -l JavaScript -e '
  const Notes = Application("Notes");
  const account = Notes.defaultAccount;

  // Create folder if it does not exist
  let folder = account.folders().find(f => f.name() === "Automation");
  if (!folder) {
    folder = Notes.Folder({ name: "Automation" });
    account.folders.push(folder);
  }

  // Add note to folder
  const note = Notes.Note({
    name: "Organized Note",
    body: "<p>This note lives in the Automation folder.</p>"
  });
  folder.notes.push(note);
  `Created in folder: ${folder.name()}`;
'

Step 6: Delete a Note

# Delete by name (moves to Recently Deleted)
osascript -l JavaScript -e '
  const Notes = Application("Notes");
  const notes = Notes.defaultAccount.notes();
  const target = notes.find(n => n.name() === "Hello from Automation");
  if (target) {
    Notes.delete(target);
    "Note deleted";
  } else {
    "Note not found";
  }
'

Note Properties

Property Type Writable Description
name string Yes Note title (first line)
body string (HTML) Yes Full note content as HTML
id string No Unique identifier
creationDate Date No When note was created
modificationDate Date No Last modification
container Folder No Parent folder

Output

  • Created a note via JXA and AppleScript
  • Listed, searched, and read note content
  • Organized note into a folder
  • Deleted a note

Examples

Create one synthetic note in a pre-created, test-only local folder, read only that note back by its returned identifier, and remove it after verifying the exercise. Do not list all notes, search a live account, or create folders implicitly as part of a permission smoke test.

Error Handling

Error Cause Solution
Notes got an error Notes.app not running Add Notes.activate() first
Empty body Note has no text content Check note is not just an image
Can't make folder Folder already exists Check before creating
Slow response iCloud sync in progress Wait for sync; use local account

Resources

Next Steps

Proceed to apple-notes-local-dev-loop for development workflow setup.

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/jeremylongshore-tons-of-skills-marketplace-apple-notes-h-eda7af/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

jeremylongshore-tons-of-skills-marketplace-apple-notes-h-eda7af.ocm.jsonjson
{
  "ocm": "1",
  "id": "jeremylongshore-tons-of-skills-marketplace-apple-notes-h-eda7af",
  "kind": "skill",
  "name": "apple-notes-hello-world",
  "description": "Create, read, and list Apple Notes using JXA and AppleScript. Use when learning Notes automation, creating your first automated note, or testing read/write access to Apple Notes from scripts. Trigger: \"apple notes hello world\", \"create apple note\", \"read apple notes\", \"apple notes example\", \"osascript notes\".",
  "publisher": "jeremylongshore",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "general_chat"
    ],
    "tags": [
      "skill-md",
      "saas",
      "macos",
      "apple-notes",
      "automation",
      "jxa",
      "skills-sh"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Create, read, and list Apple Notes using JXA and AppleScript. Use when learning Notes automation, creating your first automated note, or testing read/write access to Apple Notes from scripts. Trigger: \"apple notes hello world\", \"create apple note\", \"read apple notes\", \"apple notes example\", \"osascript notes\"."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "skills.sh",
      "repository": "https://github.com/jeremylongshore/tons-of-skills-marketplace",
      "path": "skills/.curated/apple-notes-hello-world/SKILL.md",
      "ref": "HEAD",
      "url": "https://github.com/jeremylongshore/tons-of-skills-marketplace/blob/HEAD/skills/.curated/apple-notes-hello-world/SKILL.md",
      "key": "jeremylongshore/tons-of-skills-marketplace/skills/.curated/apple-notes-hello-world/SKILL.md"
    },
    "compatibility": "Designed for Claude Code",
    "allowed_tools": [
      "Read,",
      "Write,",
      "Edit,",
      "Bash(osascript:*)"
    ],
    "license": "MIT"
  },
  "instructions": "# Apple Notes Hello World\n\n## Overview\n\nCreate, read, search, and delete Apple Notes using JXA (JavaScript for Automation) via `osascript`. All examples work from the command line on macOS.\n\n## Prerequisites\n\n- Completed `apple-notes-install-auth` (permissions granted)\n- macOS with Notes.app\n\n## Instructions\n\n### Step 1: Create a Note\n\n```bash\n# JXA: Create a note in the default folder\nosascript -l JavaScript -e '\n  const Notes = Application(\"Notes\");\n  const defaultFolder = Notes.defaultAccount.folders[0];\n  const newNote = Notes.Note({\n    name: \"Hello from Automation\",\n    body: \"<h1>Hello ",
  "cost": {
    "context_tokens": 1145
  }
}

Fetch it by URL: GET /api/v1/registry/jeremylongshore-tons-of-skills-marketplace-apple-notes-h-eda7af/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.