| name | notes_table |
| description | Insert a table into a Notes note. Notes' table feature is
triggered by Cmd+Opt+T while the body has focus; this skill
selects the note, focuses the body, and fires the keystroke.
Default: a 2x2 table (Notes' default). To get larger, use the
`rows` and `cols` args — the skill will Tab + Return as needed
after insertion to grow the table to the requested dimensions.
|
| command | ["sh","-c","NOTE=\"$1\"; ROWS=\"${2:-2}\"; COLS=\"${3:-2}\"\n[ -z \"$NOTE\" ] && { echo \"note title required\" >&2; exit 1; }\n\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 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\n delay 0.3\n -- Move to end of body so the table inserts after existing content\n key code 125 using {command down}\n delay 0.1\n keystroke return\n delay 0.1\n -- Cmd+Opt+T inserts default 2-col 2-row table\n keystroke \"t\" using {command down, option down}\n delay 0.6\nend tell\n\n-- Grow rows: each Tab from last cell creates a new row\ntell application \"System Events\"\n set extraRows to ($ROWS - 2)\n set extraCols to ($COLS - 2)\n if extraCols > 0 then\n -- Add columns via Format > Table > Add Column After\n -- (no default keyboard shortcut; navigate menu)\n try\n tell process \"Notes\"\n repeat extraCols times\n click menu item \"Add Column After\" of menu of menu item \"Table\" of menu \"Format\" of menu bar 1\n delay 0.2\n end repeat\n end tell\n end try\n end if\n if extraRows > 0 then\n -- Place cursor in last cell, then Tab from rightmost-bottom cell creates a new row\n -- Simpler: Format menu approach\n try\n tell process \"Notes\"\n repeat extraRows times\n click menu item \"Add Row Below\" of menu of menu item \"Table\" of menu \"Format\" of menu bar 1\n delay 0.2\n end repeat\n end tell\n end try\n end if\nend tell\nreturn \"ok: inserted $ROWS x $COLS table\"\nAPPLE\n","_"] |
| args | ["{{note}}","{{rows}}","{{cols}}"] |
| schema | {"note":{"type":"string","description":"Exact note title","required":true},"rows":{"type":"number","description":"Number of rows (default 2)","required":false,"default":2},"cols":{"type":"number","description":"Number of columns (default 2)","required":false,"default":2}} |
| timeout | 25 |
notes_table — insert a table into a Notes note
Notes' Cmd+Opt+T inserts a 2x2 table at the cursor. This skill
focuses the body, fires the shortcut, then optionally grows via
Format menu ("Add Row Below", "Add Column After").
Examples
notes_table note="KinBench Table 172"
→ ok: inserted 2 x 2 table
notes_table note="KinBench Table 172" rows=3 cols=3
→ ok: inserted 3 x 3 table