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: "apple notes hello world", "create apple note", "read apple notes", "apple notes example", "osascript notes".
What this skill does
# 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
```bash
# 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
```bash
# 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
```bash
# 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
```bash
# 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
```bash
# 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
```bash
# 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
## 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
- [AppleScript Notes Dictionary](https://www.macosxautomation.com/applescript/notes/)
- JXA Examples
- [osascript Manual](https://ss64.com/mac/osascript.html)
## Next Steps
Proceed to `apple-notes-local-dev-loop` for development workflow setup.
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.