From apple-notes-pack
Sets up hot-reload workflow for JXA scripts automating Apple Notes on macOS, with chokidar file watching, osascript runner, and test helpers for note CRUD.
How this skill is triggered — by the user, by Claude, or both
Slash command
/apple-notes-pack:apple-notes-local-dev-loopThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Iterative development workflow for Apple Notes JXA scripts with file watching and test helpers.
Iterative development workflow for Apple Notes JXA scripts with file watching and test helpers.
mkdir apple-notes-automation && cd apple-notes-automation
npm init -y
npm install -D chokidar tsx typescript
// src/dev/watch-runner.ts
import { watch } from "chokidar";
import { execSync } from "child_process";
watch("scripts/*.js", { ignoreInitial: true }).on("change", (path) => {
console.log(`Changed: ${path} — running...`);
try {
const output = execSync(`osascript -l JavaScript "${path}"`, { encoding: "utf8" });
console.log(output);
} catch (err: any) {
console.error(err.stderr);
}
});
console.log("Watching scripts/*.js for changes...");
// src/dev/test-notes.ts
import { execSync } from "child_process";
function runJxa(script: string): string {
return execSync(`osascript -l JavaScript -e '${script}'`, { encoding: "utf8" }).trim();
}
function getNoteCount(): number {
return parseInt(runJxa("Application(\"Notes\").defaultAccount.notes.length"));
}
function createTestNote(title: string): string {
return runJxa(`
const Notes = Application("Notes");
const note = Notes.Note({name: "${title}", body: "<p>Test</p>"});
Notes.defaultAccount.folders[0].notes.push(note);
note.id();
`);
}
export { runJxa, getNoteCount, createTestNote };
{
"scripts": {
"dev": "tsx src/dev/watch-runner.ts",
"test:notes": "tsx src/dev/test-notes.ts"
}
}
npx claudepluginhub jeremylongshore/claude-code-plugins-plus-skills --plugin apple-notes-packSets up macOS permissions for Apple Notes automation with AppleScript, JXA, osascript, and Shortcuts. Includes access tests, CLI wrapper script, and Shortcuts verification.
Automates macOS apps via Apple Events using AppleScript (discovery), JXA (legacy), and PyXA (modern Python). Use when asked to "automate Mac apps", "write AppleScript", "JXA scripting", "osascript automation", or "PyXA Python automation". Foundation skill for all macOS app automation.
Authors JXA (JavaScript for Automation) scripts for macOS app automation using Application() calls. Covers ES5 syntax constraints, run() function structure, for-loops, properties(), and .whose() filtering.