ASObjC in Automator?

I’ve been trying to create a system service in Automator using Shane’s Data Detectors ASObjC code. It runs fine with sample text in Script Debugger, but when I try it in Automator I get the lovely error message in the screenshot. Anyone know if there’s a workaround?

(Just realized that part of the script in the screenshot was from an attempt to call the data detectors handler from a library script, but it doesn’t work either way.)

That sounds like input contains a list of strings.

Just one string, the “Get Specified Text” string for testing purposes, or the selected text when it’s actually run as a service.

BTW I have found a workaround via Keyboard Maestro in place of Automator, but only by using the clipboard, which I’d prefer to avoid if I can.

I think you’ll find that received input is always a list. Try something like log class of input to confirm it.

Aha, you’re right. Coercing it to text before passing it to the handler seems to have done the trick. Mucho thanko!