update_note
Modify existing Apple Notes by replacing content with new Markdown while keeping the original folder location.
Instructions
Update an existing note in Apple Notes. Deletes the old note and creates a new one with the given Markdown content, preserving the original folder.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | Title of the existing note to update | |
| markdown | Yes | New Markdown content for the note. First line (with or without #) becomes the title. | |
| folder | No | Folder name to scope the search for the existing note |
Implementation Reference
- src/applescript.ts:157-172 (handler)The implementation of update_note, which finds the original note folder, deletes the existing note, and creates a new one with the updated content.
export async function updateNote( title: string, markdown: string, folder?: string ): Promise<string> { // 1. Find the note's current folder via SQLite const row = findNoteByTitle(title, folder); if (!row) throw new Error(`Note not found: ${title}`); const originalFolder = row.folder || "Notes"; // 2. Delete the old note await deleteNote(title, folder); // 3. Create the new note in the original folder return createNote(markdown, originalFolder); }