Problem Attic. Insert witty tagline here.

This is now an archive; you can find my current blog at http://problemattic.net/.

Previously: Requesting Aid Since: To Noone in Particular 

SubEthaEdit Markdown Preview

In lieu of a “Filter before Preview” option in SubEthaEdit, try the following as an AppleScript. It will open the front document in Safari after running Markdown (or Textile, or any similar filter) on it. Yes, it’s a bit of a hack, but it works, which is the main thing.


set command to "/usr/local/bin/Markdown.pl"

tell application "SubEthaEdit"
    set content to text of front document
    set doc to (name of front document) as text
    log doc
    do shell script "echo " & quoted form of content & 
        " | " & command & " > /tmp/" & quoted form of doc & ".html"
end tell

tell application "Safari"
    open ":tmp:" & doc & ".html"
end tell

Posted on Mon 9 Jan 06, 1:06 am

More Posts In:

2 Comments

  1. Comment by Chris Clark • Tue 25 Jul 06, 7:18 pm #

    Caveat emptor: in the current version of SubEthaEdit (2.5), the line:

    `set content to text of front document`

    Must be edited to:

    `set content to plain text of front document`

    That is all.

  2. Pingback by Markdown, blog és mac - Worldshots • Fri 6 Oct 06, 8:52 pm #

    […] A megoldás igazi szépsége abban rejlik, hogy több módon is beilleszthető mac környezetbe. A Humane Text Service a szervíz menüben ülve konvertál XHTML és Markdown közt - nálam ugyan fennakadt az ő/ű karaktereken -, a legeditorabb Textmate alapból támogatja a Markdownt - és bővíthető XML-RPC klienssel is! -, és még SubEthaEdithez is található preview szkript. […]

Sorry, the comment form is closed at this time.