I saw that programmer extraordinaire Mike Lee posted to Twitter, wondering if MarsEdit had a way to turn comments off by default when writing a new post. If there is a way to do that within the program, I don’t know it — but I do know how to do that in AppleScript! (UPDATE – […]

tell application "MarsEdit"
    make new document
    tell document 1
        set comment status to 2
    end tell
end tell

This was originally published on the Red Sweater forum by Daniel Jalkut, and I have added it to the code library here! — Justin: It takes the highlighted text and turns it into a link to the frontmost page in Safari, complete with the appropriate title tag.

tell application "Safari"
    set t to name of window 1
    set s to URL of document 1
end tell

tell application "MarsEdit"
    set u to selected text of document 1
    set selected text of document 1 to "<a href=\"" & s & "\" title=\"" & t & "\">" & u & "</a>"
end tell