| name | apple-notes-core-workflow-a |
| description | Build automated note management workflows with Apple Notes JXA scripts.
Use when batch-creating notes, syncing content from external sources,
organizing notes into folder hierarchies, or building note templates.
Trigger: "apple notes workflow", "batch notes", "note templates",
"organize apple notes", "sync notes".
|
| allowed-tools | Read, Write, Edit, Bash(osascript:*), Bash(node:*), Grep |
| version | 1.6.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","macos","apple-notes","automation","workflow"] |
| compatibility | Designed for Claude Code |
Apple Notes Core Workflow A — Note Management Automation
Overview
Primary workflow: automate Apple Notes management with batch creation, template-based note generation, folder organization, and content sync from external sources (Markdown files, RSS, calendar events).
Instructions
Step 1: Batch Note Creator from Markdown Files
#!/bin/bash
FOLDER_NAME="${1:-Imported}"
for md_file in *.md; do
[ -f "$md_file" ] || continue
title=$(head -1 "$md_file" | sed 's/^#\s*//')
body=$(cat "$md_file" | sed 's/^# /<h1>/;s/$/<\/h1>/' | sed 's/^## /<h2>/;s/$/<\/h2>/' | sed 's/^- /<li>/;s/$/<\/li>/' | sed 's/^$/<br>/')
osascript -l JavaScript -e "
const Notes = Application('Notes');
const account = Notes.defaultAccount;
let folder = account.folders().find(f => f.name() === '$FOLDER_NAME');
if (!folder) {
folder = Notes.Folder({ name: '$FOLDER_NAME' });
account.folders.push(folder);
}
const note = Notes.Note({ name: '$title', body: \`$body\` });
folder.notes.push(note);
'Created: $title';
"
echo "Imported: $md_file → $title"
done
Step 2: Note Template Engine (JXA)
const = ();
= {
: ,
: ,
: ,
};
() {
template = [templateName];
(!template) ();
account = .;
folder = account.().( f.() === folderName);
(!folder) {
folder = .({ : folderName });
account..(folder);
}
body = (data);
note = .({ : data. || templateName, body });
folder..(note);
note.();
}
(, {
: ,
: ,
}, );