Shortcuts & Automation¶
The fn CLI works with any tool that can run shell commands: Apple Shortcuts, Raycast, Python, cron, and more.
Important: Always use the full path /usr/local/bin/fn in automation contexts — the PATH may not include it.
Apple Shortcuts¶
Quick Capture to Daily Note¶
Captures text (typed or dictated) and appends it to today's daily note with a timestamp.
- Ask for Input — Type: Text, Prompt: "What's on your mind?", variable:
Capture - Get Current Date — variable:
Now - Format Date — Date:
Now, Format: CustomHH:mm, variable:Time - Run Shell Script — Shell:
/bin/zsh - Show Notification — Title: "Captured", Body:
Capture
Variant: Replace step 1 with Dictate Text for hands-free voice capture.
Morning Brief — Today's Tasks¶
Shows overdue and due-today tasks as a formatted list.
- Run Shell Script — Shell:
/bin/zshOVERDUE=$(/usr/local/bin/fn tasks --overdue --json 2>/dev/null) TODAY=$(/usr/local/bin/fn tasks --due-today --json 2>/dev/null) echo "OVERDUE" echo "$OVERDUE" | /usr/bin/python3 -c " import sys, json tasks = json.load(sys.stdin) if not tasks: print(' None!') for t in tasks: note = t.get('noteTitle', '?') text = t.get('text', '') due = t.get('dateDue', '')[:10] if t.get('dateDue') else '' prefix = f' [{due}]' if due else ' ' print(f'{prefix} {text} ({note})') " echo "" echo "DUE TODAY" echo "$TODAY" | /usr/bin/python3 -c " import sys, json tasks = json.load(sys.stdin) if not tasks: print(' None!') for t in tasks: note = t.get('noteTitle', '?') text = t.get('text', '') pri = t.get('priority', '') flag = ' !!' if pri == 'high' else '' print(f' {text}{flag} ({note})') " - Choose from Menu — Prompt: script output, Options: "Open FoldNotes" →
open "foldnotes://", "Done"
Variant: Set as Automation → Time of Day (e.g. 8:00 AM) for a daily morning prompt.
New Note from Share Sheet¶
Receives text from any app and creates a FoldNotes note.
Setup: Enable Show in Share Sheet, accept Text, URLs, Rich Text.
- Receive input from Share Sheet → variable:
SharedText - Ask for Input — Prompt: "Note title:", variable:
Title - If
Titlehas value, use it. Otherwise, format current date asyyyy-MM-dd HH.mmfor the title. - Run Shell Script — Pass
SharedTextto stdin: - Show Notification with result
- Choose from Menu — "Open in FoldNotes" →
fn open "${Title}", "Done"
Python¶
import subprocess
import json
# List recent notes as JSON
result = subprocess.run(
["fn", "list", "--sort", "modified", "--limit", "10", "--json"],
capture_output=True, text=True
)
notes = json.loads(result.stdout)
for note in notes:
print(f"{note['title']} — {note['modified']}")
# Create a note
subprocess.run([
"fn", "create", "Weekly Review",
"--content", "# Weekly Review\n\n## Wins\n\n## Challenges\n",
"--tag", "review",
"--quiet"
])
# Get overdue tasks
result = subprocess.run(
["fn", "tasks", "--overdue", "--json"],
capture_output=True, text=True
)
tasks = json.loads(result.stdout)
print(f"{len(tasks)} overdue tasks")
Raycast¶
Create a Raycast Script Command (bash):
#!/bin/bash
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Quick Capture
# @raycast.mode silent
# @raycast.argument1 { "type": "text", "placeholder": "Note text" }
/usr/local/bin/fn daily append "$1" --quiet
echo "Captured to daily note"
Tips¶
- Keyboard shortcut: In System Settings → Keyboard → Shortcuts → Services, assign a hotkey to any Shortcut.
- Menu bar: In Shortcut settings, enable "Pin in Menu Bar" for quick access.
- Error handling: Add
2>&1to capture stderr. Check$?for exit codes (0=success, 2=not found, 3=no collection). - JSON parsing: Use
/usr/bin/python3 -c "import json..."orjqfor JSON processing.