Skip to content
Tzu-ping Chung edited this page Aug 6, 2015 · 4 revisions

Open a File in MacDown from Terminal

MacDown ships with a utility at MacDown.app/Contents/SharedSupport/bin/macdown. You can use this to launch MacDown straight from the Terminal. I use the following Bash function to access it:

macdown() {
    "$(mdfind kMDItemCFBundleIdentifier=com.uranusjr.macdown | head -n1)/Contents/SharedSupport/bin/macdown" $@
}

Note: You need to first launch MacDown at least once for this command to work. This registers com.uranusjr.macdown to OS X so that mdfind recognises MacDown by that identifier.

Open files with MacDown:

$ macdown file.md another_file.md yet_another_file.md

If you’re an experienced CLI user, you might know the open -a MacDown file.md trick. The advantage of this utility over open -a MacDown is that it can also be used to create files. So

$ macdown file.md

will open file.md if it exists, or create a new document with that name if it does not.

Clone this wiki locally