Content is user-generated and unverified.

Opening Markdown Files in Obsidian Web Clipper's Reader Mode

A step-by-step guide for macOS: wrap a shell script in an Automator app so that double-clicking any .md file in Finder renders it as HTML and opens it in your browser, where the Obsidian Web Clipper's Reader mode can be applied with one click.

How it works

The Obsidian Web Clipper's Reader mode operates on whatever HTML is in the current browser tab — internally it runs Defuddle on the document, which extracts the article element and round-trips it through markdown. The URL validation gate in the extension's source is explicit: http://, https://, and file:/// URLs are all valid. So if you render a .md file to a minimal HTML skeleton on disk and open it as a file:// URL, Reader will work on it.

Prerequisites

  • pandoc installed (brew install pandoc)
  • Obsidian Web Clipper installed in your default browser
  • "Allow access to file URLs" enabled for the extension — Chrome: chrome://extensions → Obsidian Web Clipper → Details → toggle on
  • "Open behavior" set to "Reader" in the Web Clipper's settings, so a single click on the extension icon drops the page into Reader

Step by step

1. Open Automator

Spotlight (⌘ Space), type "Automator", hit Enter.

2. New document

It'll prompt you with a "Choose a type for your document" sheet. Pick Application, click Choose.

3. Find the Run Shell Script action

The window has three columns. Left column is "Library" (categories) and search field at top. Type run shell script into the search box. The middle column will show Run Shell Script under Utilities. Drag it across to the big empty area on the right.

4. Configure the action

The dropped action becomes a panel with two dropdowns:

  • Shell: /bin/bash
  • Pass input: change from "to stdin" to as arguments — this is the bit that makes "$@" contain the file paths Finder hands over.

5. Paste the script

Paste this into the text box, replacing the default cat line:

bash
export PATH="/opt/homebrew/bin:/usr/local/bin:$PATH"

for MD in "$@"; do
  [ -f "$MD" ] || continue

  TITLE=$(basename "$MD" .md)
  OUT="$(mktemp -d)/${TITLE}.html"

  BODY=$(pandoc -f gfm+footnotes+tex_math_dollars -t html --mathjax "$MD")

  cat > "$OUT" <<EOF
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>${TITLE}</title>
</head>
<body>
  <article>
    <h1>${TITLE}</h1>
    ${BODY}
  </article>
</body>
</html>
EOF

  open "$OUT"
done

6. Save

⌘S. Name it Obsidian Reader. For "Where:" pick Applications (under your home folder, ~/Applications, or the system /Applications — either works). File Format stays as Application. Click Save.

7. Test it once before changing defaults

In Finder, right-click any .md file → Open WithOther… → navigate to Obsidian Reader.app, select it, click Open. The browser should open with the rendered HTML. If something fails, see the troubleshooting below.

8. Make it the default for .md

Right-click any .md file in Finder → Get Info (⌘I). In the Info window, expand the Open with: section. Choose Obsidian Reader from the dropdown (use Other… if it's not listed; you may need to toggle "Enable: All Applications" in the chooser to make non-traditional .md openers visible). Click Change All… and confirm.

That's it. Double-clicking any .md in Finder now runs the script.

Troubleshooting

In rough order of likelihood:

  • Nothing happens / opens then closes instantly. Open Console.app, filter for "Obsidian Reader", trigger the app, look for the error. Usually it's pandoc: command not found — meaning pandoc isn't where the script's PATH expects. Run which pandoc in Terminal. If it's neither /opt/homebrew/bin/pandoc nor /usr/local/bin/pandoc, edit the export PATH=... line in the Automator action to include its actual directory.
  • Pandoc not installed at all. brew install pandoc in Terminal.
  • "Obsidian Reader" can't be opened because Apple cannot check it for malicious software. Right-click the .app once → Open → confirm. Mac remembers the exception. Required because you built the app yourself and it's unsigned.
  • Page opens in the browser but the clipper icon does nothing. Re-check that "Allow access to file URLs" is on for the extension at chrome://extensions (or your browser's equivalent).

Notes on Obsidian wikilinks

Pandoc passes Obsidian-flavoured wikilinks ([[foo]]) and transclusions (![[foo]]) through as literal text. If your typical notes rely on these and you want them rendered properly, either pre-process with sed to rewrite them as ordinary links, or swap pandoc for a converter that handles them natively (e.g. a small marked script with custom extensions).

Content is user-generated and unverified.
    How to Open Markdown Files in Obsidian Reader Mode | Claude