Saturday, November 27, 2021

#1 2021-10-27 02:54:47 pm

BitCy
Member
Registered: 2020-01-12
Posts: 17

Syntax error in my Automator

Hello,

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


Applescript:

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 "[url]https://www.imdb.com/find?s=all&q=[/url]" & selText
end run

May I know how can I fix this error?

Thank you.

Last edited by BitCy (2021-10-27 02:55:09 pm)

Offline

 

#2 2021-10-29 07:07:25 pm

Mockman
Member
From:: Toronto
Registered: 2020-05-27
Posts: 150

Re: Syntax error in my Automator

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

Offline

 

#3 2021-10-31 08:58:52 pm

BitCy
Member
Registered: 2020-01-12
Posts: 17

Re: Syntax error in my Automator

Mockman wrote:

'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.

Offline

 

#4 2021-11-01 03:15:25 am

Nigel Garvey
Moderator
From:: Warwickshire, England
Registered: 2002-11-20
Posts: 5438

Re: Syntax error in my Automator

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.


NG

Offline

 

#5 2021-11-10 10:17:04 pm

BitCy
Member
Registered: 2020-01-12
Posts: 17

Re: Syntax error in my Automator

I have fixed this using shortcuts.

Thank you!

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)