Skip to content

Shortcuts & Automation#

FoldNotes can be driven from automation tools on both iOS and macOS. There are two distinct surfaces:

  • Shortcuts app actions — typed parameters, no shell required. Available on iOS, iPadOS and macOS wherever FoldNotes is installed.
  • The fn CLI — full read/write access to your collection from the command line. macOS only, bundled with the app and installed via the Install Command Line Tool… menu item.

Platform support#

iOS / iPadOS macOS
Shortcuts app actions
fn CLI
Python / Raycast / cron

If your workflow can be expressed with the Shortcuts actions, prefer that — it works the same on every Apple device and survives app updates without re-wiring. Drop to the CLI on macOS when you need something the actions don't cover: parsing JSON output, chaining several reads and writes in one place, or driving FoldNotes from a shell script.


Shortcuts app#

With FoldNotes installed, the Shortcuts app's action picker shows a FoldNotes section. The same set of actions is available on iPhone, iPad and Mac.

Available actions#

Reading#

Action Returns Parameters
Get Note Text Text (note body) Note
List Notes List of notes Favourites only, Tag, Tag match, Modified within, Limit, Collection
Search Notes List of notes Query, Limit, Collection
Today's Tasks List of tasks Limit, Collection
Overdue Tasks List of tasks Limit, Collection
Get Tasks List of tasks Filter, Limit, Collection

Creating#

Action Returns Parameters
Create Note Note Title, Body, Collection

Updating#

Action Returns Parameters
Append to Note Note Note, Content
Append to Daily Note Note Date (optional, defaults to today), Content, Collection
Action Returns Parameters
Open Note Note

Notes about action behaviour#

  • Date parameters are strongly typed. Type "next Friday" into a date field and Shortcuts will refuse to wire it directly — chain a Get Dates from Input action first to convert the text to a real Date.
  • Append to Daily Note creates the daily note on demand if it doesn't yet exist. New daily notes are seeded with the day's heading plus Overdue and Due Today sections — same shape the Daily Note button produces in the app.
  • Get Note Text returns the full markdown body of the chosen note as plain text. The body is read fresh from disk, so it includes iCloud-synced changes from other devices.
  • Collection parameter, where present, is optional — leave empty to target your default collection.

Examples#

Append text to last Friday's daily note#

Useful when you want to retroactively log something to a previous day. Combines a natural-language date phrase with our daily-note append action.

  1. Ask for Input — Question: "What would you like to add to last Friday's daily note?", Input Type: Text. Output: Provided Input.
  2. Text"last Friday". Output: Text.
  3. Get Dates from Input — Input: Text. Output: Dates.
  4. Append to Daily Note — Date: First Item from Dates, Content: Provided Input.
  5. Show Notification"Added to Friday's daily note."

Variants:

  • Replace "last Friday" with any phrase Get Dates from Input understands: "yesterday", "two days ago", "the start of this week", "next Monday".
  • Add Open Note as the final step with the result from Append to Daily Note if you want the app to jump to the note after writing.

Voice-captured quick note to today#

  1. Dictate Text — Output: Dictated Text.
  2. Current Date — Output: Current Date.
  3. Append to Daily Note — Date: Current Date, Content: Dictated Text.
  4. Show Notification"Captured."

Morning brief#

  1. Overdue Tasks — Output: Overdue.
  2. Today's Tasks — Output: Today.
  3. Combine Text with line breaks: "Overdue:" + Overdue + "Today:" + Today.
  4. Show Result (or Speak Text if you want it read aloud).

Wire this to a Personal Automation triggered at a chosen time of day for a recurring morning briefing.

Share Sheet → new note#

Set the shortcut up to Receive Text and URLs from Share Sheet.

  1. Get Shortcut Input — Output: Shortcut Input.
  2. Ask for Input — Question: "Title for this note?", Default Answer: blank.
  3. Create Note — Title: Provided Input, Body: Shortcut Input.
  4. Open Note — Note: Created Note.

macOS only: the fn CLI#

The Mac app bundles fn, a full-featured command-line tool for FoldNotes. After installing it from the FoldNotes menu (FoldNotes → Install Command Line Tool…), invoke it from any shell with absolute path /usr/local/bin/fn — useful in scripts where PATH isn't reliable.

When to reach for the CLI#

  • You need to combine several operations in one place (read tasks, format them, write the result somewhere).
  • You want JSON output for parsing in Python, jq, or another tool.
  • You're scripting recurring jobs with cron or launchd.
  • You're integrating with Raycast, Alfred, or another macOS launcher that runs shell scripts.

Quick capture to daily note (with timestamp prefix)#

  1. Ask for Input — Type: Text, Prompt: "What's on your mind?". Output: Capture.
  2. Current Date — Output: Now.
  3. Format Date — Date: Now, Format: Custom HH:mm. Output: Time.
  4. Run Shell Script — Shell: /bin/zsh:
    /usr/local/bin/fn daily append "**${Time}** — ${Capture}" --quiet
    
  5. Show Notification — Title: "Captured", Body: Capture.

The Shortcuts action Append to Daily Note covers the simple case; the CLI variant is here when you want the timestamp prefix or other shell-side formatting that the action doesn't expose.

Morning brief — formatted text from JSON#

OVERDUE=$(/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('dueDate', '')[:10] if t.get('dueDate') 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})')
"

Wrap it in a Choose from Menu step ("Open FoldNotes", "Done") and you have a launchable morning brief. Add as a Personal Automation triggered at 8 AM for a daily nudge.

New note from Share Sheet (CLI version)#

Receives text from any app and creates a FoldNotes note via the CLI, with tagging.

  1. Receive input from Share Sheet → variable: SharedText.
  2. Ask for Input — Prompt: "Note title:", Output: Title.
  3. Run Shell Script — pass SharedText to stdin:
    /usr/local/bin/fn create "${Title}" --tag shared --quiet 2>&1
    
  4. Show Notification with result.

Use this version (instead of the Create Note action) when you want CLI-side tagging or the --quiet exit-code semantics for chaining.


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['modifiedDate']}")
# 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: On macOS, System Settings → Keyboard → Shortcuts → Services lets you assign a hotkey to any Shortcut.
  • Menu bar: In a Shortcut's settings, enable Pin in Menu Bar for quick access on macOS.
  • Home Screen / Lock Screen (iOS): long-press a Shortcut and choose Add to Home Screen for one-tap access.
  • Error handling (CLI): Add 2>&1 to capture stderr. Check $? for exit codes (0 success, 2 not found, 3 no collection).
  • JSON parsing: Use /usr/bin/python3 -c "import json…" or jq for JSON processing of CLI output.