| 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".
|
| allowed-tools | Read, Write, Edit, Bash(osascript:*) |
| version | 1.6.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","macos","apple-notes","automation","jxa"] |
| compatibility | Designed for Claude Code |
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
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();
'
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
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
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
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
osascript -l JavaScript -e