Jump to content

Universal Action: Markdown to RTF Email

Recommended Posts

I'm trying to create a universal action that will allow me to select some Markdown text and convert it to RTF in the body of an email message. From the debugger, it looks like I'm sending RTF to the clipboard ok (but I'm not certain) and it seems like the AppleScript to create the mail message isn't liking what's on the clipboard ...




[16:50:35.703] ERROR: MD>Email[Run NSAppleScript] {
    NSAppleScriptErrorBriefMessage = "Expected \U201ctell\U201d, etc. but found identifier.";
    NSAppleScriptErrorMessage = "Expected \U201ctell\U201d, etc. but found identifier.";
    NSAppleScriptErrorNumber = "-2741";
    NSAppleScriptErrorRange = "NSRange: {203, 7}";


Link to comment

Thanks Vitor. I did originally start from Markdown Transform, but I couldn't figure out how to pass the text to the AppleScript in order to create the mail message--I thought pandoc might be an easier route, but it doesn't seem like it. 


I did find a clunky workaround using MarkdownTransform now after playing with it a bit. I can use your RTF conversion, then chain it to an AppleScript that creates a new mail message, then just send 4 tab keys and a cmd-V to paste the message into the body. I'd much prefer finding a way to send the RTF to the AppleScript directly, but I guess this works.




Edited by derekvan
added link to workflow
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...