Syntax error in my Automator

Hello,

I get an Syntax error of “Can’t make quoted form of item 1 into type Unicode text.”

on run {input, parameters}
	-- encode the selected text
	set selText to do shell script "/usr/bin/perl -Mencoding=utf8 -MURI::Escape=uri_escape_utf8 -lne 'print uri_escape_utf8($_)' <<<" & quoted form of (item 1 of input)
	open location "https://www.imdb.com/find?s=all&q=" & selText
end run

May I know how can I fix this error?

Thank you.

‘Item 1 of input’ is likely something that can’t be directly coerced into text. It may requre an intermediary coercion.

How can I fix this?

Thank you.

Hi BitCy.

It might help if you tell us what the previous actions are in the workflow. If we can get an idea of the output from the immediately preceding action, it might reveal the exact nature of the input here.

By the way, the visible [url] and [/url] tags in the ‘open location’ line are probably an artefact introduced by MacScripter’s own display software. Apologies for this.

I have fixed this using shortcuts.

Thank you!