When running a service (in this case the Markdown Service Tools MultiMarkdown to RTF service), I'm getting "Couldn't communicate with a helper application." However, the actual error in console is shown below, an unexpected type error. This was working fine until High Sierra.
The service:
- takes text input, generates RTF using multimarkdown->html->textutil
- Uses pbcopy -Prefer rtf to put the result in the clipboard as rich text (rtf)
- the service retrieves the content of the clipboard and that's what it returns
Here's the error, any insight would be welcome:
<NSXPCConnection: 0x60c000300240> connection to service named com.apple.automator.xpc.runner: Exception caught during decoding of received message, dropping incoming message.
Exception: Exception while decoding argument 1 (#3 of invocation):
<NSInvocation: 0x60400026cd40>
return value: {v} void
target: {@} 0x0
selector: {:} null
argument 2: {Q} 2
argument 3: {@} 0x0
Exception: value for key 'NS.objects' was of unexpected class 'NSTextList'. Allowed classes are '{(
NSFont,
NSAttributedString,
NSDictionary,
AMXPCToken,
NSNumber,
NSData,
NSAppleEventDescriptor,
NSArray,
NSMutableAttributedString,
NSParagraphStyle,
NSURL,
NSColor,
NSNull,
NSString,
NSTextTab,
NSGlyphInfo
)}'.
Ok, there is something about the generated RTF that is throwing off the automation/workflow. If I highlight text in a app that has no markdown on it and run the workflow, I get no error. If I have text with only
code
, I get no error. Bulleted lists generates the type error above. Horizontal rules don't render at all, but generate no error. Tables hag the current window and make you do a force quit. Block quotes work, and they show up a italics. Links work in Notes but in Mail they only show up as blue, underlined text you can't click on.So I think we can conclude that Apple has changed how it interprets RTF code in recent OS releases and this is why this fails.
I wasn't wanting to figure out how to write RTF, but I suspect if I want this to start working I'll have to.
This should also be posted over on the MultiMarkdown6 repo since it's that binary that is actually doing the RTL rendering.