derekvan Posted January 18, 2022 Share Posted January 18, 2022 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 ... https://www.dropbox.com/s/t87xmx249x4i29l/MD>Email.alfredworkflow?dl=0 [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
vitor Posted January 19, 2022 Share Posted January 19, 2022 From experience, dealing with RTF programmatically is not pleasant indeed. Check Markdown Transform. It might already do what you need, but if not maybe you’ll get a clue (can’t check your Workflow right now, as I’m not on the Mac). Link to comment
derekvan Posted January 19, 2022 Author Share Posted January 19, 2022 (edited) 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. https://www.dropbox.com/s/ujmq23zkgtz31fy/MarkdownTransform-derek.alfredworkflow?dl=0 Edited January 19, 2022 by derekvan added link to workflow Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now