AGENT SKILL

notes_export_pdf

Export a Notes note to a PDF file at an absolute path. Notes doesn't expose Export-as-PDF via AppleScript dictionary; this skill drives the File menu + Save sheet via UI scripting. The Save sheet is the standard NSSavePanel — we type the filename into the focused field, use Cmd+Shift+G to set the destination directory, then press Return to commit. The skill does NOT use the Print → Save as PDF route (3+ extra dialog clicks); it uses Notes' direct File → Export as PDF... menu. After the save, the skill polls for the file's existence to confirm completion before returning.

使用场景文档处理
License 许可
Apache-2.0
所属仓库
LocalKinAI/kinclaw
最近更新
2026-11-01
Stars
★ 9
Forks
3

01 前言 Front Matter

args
[ "{{note}}", "{{out_path}}" ]
name
notes_export_pdf
schema
{ "note": { "type": "string", "required": true, "description": "Exact note title" }, "out_path": { "type": "string", "required": true, "description": "Absolute POSIX path where the PDF should be saved (e.g. /Users/me/Desktop/kinbench/168-note.pdf)" } }
command
[ "sh", "-c", "NOTE=\"$1\"; OUT_PATH=\"$2\"\n[ -z \"$NOTE\" ] && { echo \"note title required\" >&2; exit 1; }\n[ -z \"$OUT_PATH\" ] && { echo \"output path required\" >&2; exit 1; }\n\n# Split path into directory + filename\nOUT_DIR=\"$(/usr/bin/dirname \"$OUT_PATH\")\"\nOUT_FILE=\"$(/usr/bin/basename \"$OUT_PATH\")\"\n/bin/mkdir -p \"$OUT_DIR\"\n# Remove existing file so we can detect creation precisely\n/bin/rm -f \"$OUT_PATH\"\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 click menu item \"Export as PDF…\" of menu \"File\" of menu bar 1\n on error\n -- Fallback: try without ellipsis\n try\n click menu item \"Export as PDF\" of menu \"File\" of menu bar 1\n on error e\n return \"ERR_MENU: \" & e\n end try\n end try\n end tell\nend tell\ndelay 1.5\n\n-- Save sheet is now open. Filename field is auto-focused.\n-- 1) clear current name (Cmd+A in text field selects, then type new)\ntell application \"System Events\"\n keystroke \"a\" using {command down}\n delay 0.1\n keystroke \"$OUT_FILE\"\n delay 0.3\n -- 2) Cmd+Shift+G opens Go to: sheet inside the save panel\n keystroke \"g\" using {command down, shift down}\n delay 0.5\n keystroke \"$OUT_DIR\"\n delay 0.3\n -- 3) Press return: closes Go-to sheet\n keystroke return\n delay 0.5\n -- 4) Press return again: triggers default Save button\n keystroke return\n delay 0.5\nend tell\nAPPLE\n\n# Poll for file creation (up to 8 seconds)\nfor i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16; do\n if [ -f \"$OUT_PATH\" ]; then\n SIZE=$(/usr/bin/stat -f %z \"$OUT_PATH\")\n if [ \"$SIZE\" -gt 1000 ]; then\n echo \"ok: saved $OUT_PATH ($SIZE bytes)\"\n exit 0\n fi\n fi\n /bin/sleep 0.5\ndone\n\necho \"ERR: PDF not created at $OUT_PATH after 8s\" >&2\nexit 1\n", "_" ]
timeout
30
description
Export a Notes note to a PDF file at an absolute path. Notes doesn't expose Export-as-PDF via AppleScript dictionary; this skill drives the File menu + Save sheet via UI scripting. The Save sheet is the standard NSSavePanel — we type the filename into the focused field, use Cmd+Shift+G to set the destination directory, then press Return to commit. The skill does NOT use the Print → Save as PDF route (3+ extra dialog clicks); it uses Notes' direct File → Export as PDF... menu. After the save, the skill polls for the file's existence to confirm completion before returning.

03 SKILL.md 正文

notes_export_pdf — export a Notes note to PDF at a path

Notes' File menu has direct "Export as PDF..." which opens an NSSavePanel. The agent's typical failure mode is to open the File menu + click Export as PDF, then get lost in the Save sheet — filename field, location field (which is hidden behind a Cmd+Shift+G shortcut), and the actual Save button. This skill drives all of that deterministically.

Examples

notes_export_pdf note="KinBench Print 168" out_path="/Users/me/Desktop/kinbench/168-note.pdf"
  → ok: saved /Users/me/Desktop/kinbench/168-note.pdf (47823 bytes)

notes_export_pdf note="KinBench Export 182" out_path="/Users/me/Desktop/kinbench/182-note.pdf"
  → ok: saved /Users/me/Desktop/kinbench/182-note.pdf (45612 bytes)

Why not Print → Save as PDF

The Print → Save as PDF route requires (1) Cmd+P, (2) click PDF dropdown bottom-left, (3) click "Save as PDF…", (4) navigate Save sheet. Notes' direct File → Export as PDF... is one click + Save sheet — half the friction. This skill uses the direct path.

04 同仓库更多 Skills

LocalKinAI
LocalKinAI/kinclaw

web

Universal web tool — fetches and interacts with web pages through real Chromium (Playwright). Renders JavaScript, follows redirects, handles cookies, bypasses many anti-scrape stubs that block plain `web_fetch`. Each call launches a fresh browser, executes the requested flow, closes. ~2-3s cold start; no persistent state. Use INSTEAD of `web_fetch` when: - Target is a JS-heavy SPA (prices via XHR, lazy content) - `web_fetch` returned an anti-scrape placeholder (Zhihu's "click here" stub, JD's chrome-only HTML) - You need to interact (click, fill input) before extracting Common patterns: fetch rendered text: url=X wait for content then read: url=X wait_for=".price" extract specific element: url=X selector=".product-list" click and read result: url=X click=".search-button" fill form, then read: url=X click="input[name=q]" type_text="kinclaw" fill + Enter (React forms): url=X click="input" type_text="hi" press_enter=true wait_for=".reply" screenshot the page: url=X screenshot=true (returns image:// marker) run JS and get result: url=X js="document.title" First-time setup (one-time per machine, ~500MB Chromium download): pip install playwright playwright install chromium

文档处理测试与质量
★ 9
LocalKinAI
LocalKinAI/kinclaw

weather

Current conditions plus a three-day forecast (today / tomorrow / day after) for a place, in metric, from wttr.in. No API key. Use this for any weather question — including "明天" and "后天" — before reaching for web search.

★ 9
LocalKinAI
LocalKinAI/kinclaw

tts

Synthesize speech from text and play it through the macOS speakers. Talks to a local LocalKin Service Audio Server (default :8001 / Kokoro). When `record` is running with audio=true, the spoken audio is captured into the recording — use this in place of `shell say` for high-quality multilingual narration in demo videos. Set the TTS_ENDPOINT env var to point at a different server.

图像与多媒体Skill与智能体开发
★ 9
LocalKinAI
LocalKinAI/kinclaw

translate

Translate text between languages using the system's translate command

★ 9
LocalKinAI
LocalKinAI/kinclaw

summarize

Summarize a file's contents into key bullet points

资料检索与研究
★ 9
LocalKinAI
LocalKinAI/kinclaw

stt

Transcribe an audio file (wav/mp3/mp4/m4a) into text via a local LocalKin Service Audio Server (default :8000 / SenseVoice). Pair with `record action=start mic=true` to turn a recorded mic track into text. Set STT_ENDPOINT env var to point at a different server.

图像与多媒体
★ 9