Write in rich text, export to Markdown (with [[Wikilinks]] )

Here’s a similar solution to the above that doesn’t use AppleScript, though you still have to install Pandoc from Pandoc - Installing pandoc.

It’s faster than AppleScript (a possible consideration if frequently exporting many hundreds of notes at a time). But it requires more setup within each Tinderbox document. With the external AppleScript you can (usually) just select notes in any document that has at least the built-in HTML template assigned (File > Built-in-Templates) and run it without worrying about getting the settings right in multiple other attributes that you might not want to change anyway because sometimes you also need to export as html.

I got something like this to work:


HTMLExportFileNameSpacer needs a space (not visible in the screenshot) rather than the default _.

HTMLExportCommand is:

/usr/local/bin/pandoc -f html -t markdown_mmd | sed -E 's/@(\[.+\]).+\)/[\1]/g;t'

The regex that extracts the anchor text from internal links and surrounds them with [], thus turning them into “wikilinks” that many other apps now recognize, has a couple fewer \ to ‘escape’ characters than does the AppleScript.

Once all this is set up then to export (Multi)Markdown instead of HTML you go, naturally, to File > Export > As HTML!