I'm using Automator to open a link in Chrome based on on some selected text:
on run {input, parameters}
set kanji to input as string
set link to "https://jisho.org/search/" & kanji
tell application "Google Chrome"
open location link
end tell
end run
This works fine when the input text is ASCII, and a new Chrome tab opens at the URL, but nothing happens (and no error when put in a "try" block) when the input text is kanji (eg 漢字). Open "Safari" always works correctly, so this looks like a Chrome thing?
Chrome 91.0.4472.164, macOS 11.3.
Thanks for any insights!
Update: Thanks row and gurkensaas.
I ended up with this working version:
on run {input, parameters}
set kanji to input as string
set link to "https://jisho.org/search/" & kanji
try
tell application "Google Chrome"
tell its window 1
set URL of (make new tab) to link
end tell
end tell
on error errMsg number errorNumber
display dialog "Error occurred: " & errorNumber as text
end try
end run