KosshiKosshi
AutomationBeta
Contents

This feature is in beta, and command names or results may change. Send feedback via Contact or the Forum.

Use cases

Short AppleScript examples for Shortcuts, Spotlight, Alfred, Raycast, or scheduled runs. Replace row names such as "Trip planning" with names from your own outline, and see Running in daily use to register them (for TestFlight Beta, use "Kosshi Beta").

Open today's daily note

Creates a row for today's date (or reuses it if it already exists) and opens it. Useful as a Spotlight or Shortcuts action at the start of the day.

set dayName to do shell script "/bin/date +%Y-%m-%d"
tell application "Kosshi"
    set todayRow to ensure path {"Daily", dayName}
    show todayRow
end tell

Copy incomplete tasks

Extracts open checkbox rows under a project and copies them as Markdown to the clipboard, ready to paste into a status update or chat message. Adding with including collapsed ensures tasks inside collapsed sections are not skipped.

tell application "Kosshi"
    set projectRow to find path {"Trip planning"}
    set todoList to read outline of projectRow depth 10 query "is:todo" format markdown with including collapsed
end tell
set the clipboard to todoList

Archive completed tasks

Moves checked checkbox rows under a project into an archive branch in one command (a single ⌘Z undoes the whole move). To also include non-checkbox rows completed with ⌘Enter, replace query "is:done" with completed true.

tell application "Kosshi"
    set projectRow to find path {"Trip planning"}
    set archiveRow to ensure path {"Archive", "Trip planning"}
    set doneRows to find rows query "is:done" within projectRow
    if (count of doneRows) > 0 then move doneRows to end of rows of archiveRow
end tell

Save a full backup on a schedule

Kosshi's built-in Auto Backup stores text only. Use this script to save a restorable full backup ZIP including images and attachments to a chosen folder on a schedule.

do shell script "mkdir -p ~/Documents/'Kosshi Backups'"
set backupFolder to POSIX file ((POSIX path of (path to documents folder)) & "Kosshi Backups")
tell application "Kosshi"
    export backup to backupFolder
end tell

Running in daily use

Use Script Editor to write and test scripts, then register them with whichever launcher you already use:

  • Shortcuts (built into macOS): Add a "Run AppleScript" action, paste the script, and run it from Spotlight, the menu bar, or a keyboard shortcut.
  • Alfred / Raycast / Keyboard Maestro: Register the script as a Script Command or hotkey.
  • Terminal or scheduled runs: Run osascript your-script.applescript from shell scripts, launchd, or cron for morning daily notes or weekly backups.