| name | notes_format |
| description | Apply a Notes-app text format (bold / italic / underline / title /
heading / subheading / body) to text in a note. Handles selection
+ format keystroke + verification.
The #1 mistake agents make: pressing Cmd+B without selecting text
first. Notes' format shortcuts only act on the current selection;
no selection = no-op. This skill always selects first.
|
| command | ["sh","-c","NOTE=\"$1\"; FORMAT=\"$2\"; SELECTION=\"$3\"\n[ -z \"$NOTE\" ] && { echo \"note title required\" >&2; exit 1; }\n[ -z \"$FORMAT\" ] && { echo \"format required\" >&2; exit 1; }\n[ -z \"$SELECTION\" ] && SELECTION=\"all\"\n\n# Map format → keystroke\ncase \"$FORMAT\" in\n bold) KS_KEY=\"b\"; KS_MOD=\"command\" ;;\n italic) KS_KEY=\"i\"; KS_MOD=\"command\" ;;\n underline) KS_KEY=\"u\"; KS_MOD=\"command\" ;;\n title) KS_KEY=\"1\"; KS_MOD=\"command_option\" ;;\n heading) KS_KEY=\"2\"; KS_MOD=\"command_option\" ;;\n subheading) KS_KEY=\"3\"; KS_MOD=\"command_option\" ;;\n body) KS_KEY=\"4\"; KS_MOD=\"command_option\" ;;\n *) echo \"unknown format '$FORMAT' — use bold|italic|underline|title|heading|subheading|body\" >&2; exit 1 ;;\nesac\n\n# Select the note, focus body, then select-all + apply format\nosascript 2>&1 <<APPLE\ntell application \"Notes\"\n activate\n try\n show (first note whose name = \"$NOTE\")\n on error\n return \"ERR: note not found\"\n end try\nend tell\ndelay 0.8\n\ntell application \"System Events\"\n tell process \"Notes\"\n -- Click the note body so keystrokes go there. The body is the\n -- ScrollArea / TextArea inside the main window. We try the\n -- canonical AX path; on failure, fall back to a generic click.\n try\n set mainWin to window 1\n try\n set bodyArea to text area 1 of scroll area 1 of group 1 of splitter group 1 of mainWin\n perform action \"AXFocus\" of bodyArea\n end try\n end try\n end tell\nend tell\ndelay 0.3\n\n-- Select per SELECTION arg\ntell application \"System Events\"\n if \"$SELECTION\" is \"all\" then\n keystroke \"a\" using {command down}\n else if \"$SELECTION\" is \"first_line\" then\n -- Cmd+Up to top, then Shift+End to extend selection to end of line\n key code 126 using {command down}\n key code 119 using {shift down}\n else if \"$SELECTION\" is \"last_line\" then\n key code 125 using {command down}\n key code 115 using {shift down}\n end if\nend tell\ndelay 0.2\n\n-- Apply format\ntell application \"System Events\"\n if \"$KS_MOD\" is \"command\" then\n keystroke \"$KS_KEY\" using {command down}\n else\n keystroke \"$KS_KEY\" using {command down, option down}\n end if\nend tell\ndelay 0.3\nreturn \"ok: $FORMAT applied to $SELECTION\"\nAPPLE\n","_"] |
| args | ["{{note}}","{{format}}","{{selection}}"] |
| schema | {"note":{"type":"string","description":"Exact note title","required":true},"format":{"type":"string","description":"bold | italic | underline | title | heading | subheading | body","required":true},"selection":{"type":"string","description":"all (Cmd+A whole body — default) | first_line | last_line","required":false,"default":"all"}} |
| timeout | 15 |
notes_format — apply Notes formatting reliably
Wraps the select-then-format pattern that agents routinely get
wrong. Always selects text BEFORE pressing the format keystroke,
so the format applies to something rather than no-op'ing.
Examples
notes_format note="KinBench Bold 173" format=bold
→ ok: bold applied to all
notes_format note="KinBench Heading 174" format=title selection=first_line
→ ok: title applied to first_line
Format → keystroke mapping
| format | macOS shortcut |
|---|
| bold | Cmd+B |
| italic | Cmd+I |
| underline | Cmd+U |
| title | Cmd+Opt+1 (largest) |
| heading | Cmd+Opt+2 |
| subheading | Cmd+Opt+3 |
| body | Cmd+Opt+4 |