Automate Markdown notes with Apple Shortcuts, Siri and URLs

Managing notes6 min read

Automate Markdown notes across iPhone, iPad, and Mac by combining MiaoYan's five Shortcuts actions on iOS (Create Note, Append to Note, New Note, Open Note, and Search Notes) with its miaoyan:// URL routes (new, goto, and find) across Apple devices. Every note is a plain .md file in your folder, so text captured from the iPhone Action button or Safari lands on disk ready for iCloud sync, ripgrep, and your Mac editor. One boundary matters up front: Create Note saves to the library root on iOS while miaoyan://new saves to the selected sidebar folder on Mac, so routing files into nested subfolders on Mac works best via a short shell script.

Five Shortcuts actions and Siri phrases on iPhone and iPad

On iPhone and iPad, MiaoYan exposes five App Intents in Shortcuts, Spotlight, and Siri:

  • Create Note takes a required Title and optional multiline Text, writes a .md file directly into your library root without opening MiaoYan, notifies iCloud sync, and returns the Note item for downstream actions.
  • Append to Note takes a Note and multiline Text, adding the text on a fresh line at the end of the file in the background without switching apps.
  • New Note opens MiaoYan straight into the composer, triggered in Siri with "New note in MiaoYan" or "Write in MiaoYan".
  • Open Note opens a chosen Note in MiaoYan (downloading evicted iCloud placeholders automatically), using "Open a note in MiaoYan" in Siri.
  • Search Notes takes Search for text and opens MiaoYan's search view directly with slashes like 2026/12 preserved, using "Search MiaoYan" or "Search notes in MiaoYan".

Outside Shortcuts, MiaoYan provides a New Note Control Center control (for Control Center, Lock Screen buttons, or the iPhone Action button), a circular New Note Lock Screen widget, and Recent Notes widgets on Lock Screen and Home Screen (1, 3, or 6 notes). Widget titles and snippets are marked privacy-sensitive so iOS hides text while locked. Folder sync setup is covered in Markdown on iPad.

How Shortcuts and widgets reference files safely

Every iOS App Store update moves the app's sandbox container to a new UUID path, which would break stored absolute paths. MiaoYan stores only paths relative to your library root (Journal/2026-12-01.md) inside Note entities and widgets, rejecting .. segments, dotfiles, attachment folders, and Trash. At run time, actions resolve that relative path against your active library root: MiaoYan's iCloud Drive folder, an external folder picked in Files via security-scoped bookmark, or On My iPhone/MiaoYan.

Background writes also prevent autosave collisions. Because an open editor holds the full note in memory and writes the whole buffer on pause, Append to Note checks AppState.isEditing first and stops with "That note is being edited in MiaoYan. Tap Done there first." rather than letting autosave overwrite appended text.

URL routes and percent-encoding across Mac, iPhone, and iPad

Shortcuts on Mac, Raycast, Alfred, and scripts can drive MiaoYan with miaoyan:// links:

URL form Mac behavior iPhone and iPad behavior
miaoyan://new?title=...&txt=... Creates .md file immediately in selected sidebar folder (or root if Trash is selected) Opens New Note composer pre-filled with title and txt so saving stays a tap
miaoyan://goto/Title Opens Title.md (#Heading scrolls to that ATX heading) Opens Title.md, or searches Title if no note matches
miaoyan://find/words Focuses library search bar with words Opens Search screen with words

Because any mobile web page can trigger a URL scheme, iPhone and iPad open the pre-filled composer on miaoyan://new instead of letting random links write files silently. Mac MiaoYan also accepts legacy nv:// and nvalt:// routes (find, make, goto).

Keep two encoding rules in mind when building URLs:

  1. On Mac, MiaoYan runs escapePlus() before parsing URLs, turning literal + into %20 spaces. Encode + as %2B so C++ does not become C.
  2. Both Mac and iOS read the full URL path on miaoyan://goto/, so a slash inside a title like S3 / R2 works when encoded as %2F (miaoyan://goto/S3%20%2F%20R2), and # inside body text must be %23. Always pass dynamic inputs through Shortcuts' URL Encode action.

Four Shortcuts recipes to build

1. Silent capture from the Action button

Bind a three-step Shortcut to the iPhone Action button or Back Tap:

  1. Ask for Input (Text, prompt Capture).
  2. Format Date (Current Date, Custom yyyy-MM-dd HH-mm).
  3. Create Note with Title set to Formatted Date and Text set to Provided Input.

Pressing Done writes the .md file over whatever app you are using without switching screens.

2. Clip Safari selection and URL to a note

Enable Show in Share Sheet for Safari web pages:

  1. Get Details of Safari Web Page (Name, Page URL, Page Selection).
  2. Text containing > [Page Selection], a blank line, and Source: [[Name]]([Page URL]).
  3. On iPhone and iPad, pass Name and Text to Create Note (or Append to Note on Reading inbox). On Mac, run Name and Text through URL Encode and pass miaoyan://new?title=[Encoded Name]&txt=[Encoded Text] to Open URLs.

3. Append timestamped lines to a daily log

To append entries to Work log.md on iPhone or iPad:

  1. Ask for Input (What did you finish?).
  2. Format Date (Custom HH:mm).
  3. Append to Note targeting Work log with - [Formatted Date] [Provided Input].

4. Open today's YYYY-MM-DD note

Pair Shortcuts with daily notes in Markdown: format Current Date as yyyy-MM-dd, pass it through URL Encode, and run Open URLs with miaoyan://goto/[URL Encoded Text].

On Mac browsers, MiaoYan's web tools (including HTML to Markdown, Mermaid Editor, and Markdown Viewer) use this same route for their Save to MiaoYan button: browser JavaScript extracts the first # heading as title, wraps diagrams in code fences, encodes both with encodeURIComponent, and opens miaoyan://new?title=...&txt=... up to Chrome's 2 MB URL limit. Mac CLI workflows are in Markdown notes from the terminal.

MiaoYan for Mac is open source on GitHub, and the App Store version covers Mac, iPhone, and iPad.

What goes wrong and how to fix it

  • "Open MiaoYan once to choose where your notes live." appears before first launch or after external folder permission expires; open MiaoYan once to confirm your folder.
  • "That note is being edited in MiaoYan. Tap Done there first." means Append to Note protected an active editor buffer; tap Done in MiaoYan first.
  • Truncated body text after # or & in miaoyan://new means txt bypassed URL Encode.
  • miaoyan://find/2026/12 searches only 12 on Mac because find reads the last path component; replace / with a space, or use Search Notes on iOS.

FAQ

Are Create Note and Append to Note native actions on Mac too?

Those five App Intents ship in the iPhone and iPad app. On Mac, Shortcuts can call miaoyan:// via Open URLs, run the miao CLI, or append text directly to .md files.

Can Create Note target a subfolder on iPhone?

Create Note writes new files to the library root. To add text inside a subfolder note such as Journal/2026-12.md, target that existing note with Append to Note.

Does running miaoyan://new twice with the same title overwrite my note on Mac?

No. Mac MiaoYan creates Title 1.md, then Title 2.md. Use miaoyan://goto/ to reopen an existing note.

Does Save to MiaoYan on miaoyan.app send text to a server?

No. Browser JavaScript builds the miaoyan://new link locally and hands it straight to your Mac app.