Cannot pass contents of Chrome address bar to Automator workflow

automatorgoogle-chrome

For some time now, I have been using a keyboard shortcut to grab the selected text inside the address bar in Google Chrome and pass it to a Service (now called a Quick Action):

enter image description here

Sometime last week, I noticed that this workflow no longer receives input from the Chrome address bar. If I paste the address bar contents into Notes and select it, or select it inside Firefox and then press my keyboard shortcut the workflow still runs.

How can I access the contents of the Chrome address bar via my workflow?

Best Answer

This works for me using the latest version of macOS Mojave and Google Chrome.

Adding this following code to a run AppleScript action in your workflow, should work for you. The command copies the selected text to the clipboard

delay 1
tell application "System Events" to keystroke "c" using {command down}
delay .5
set theURL to the clipboard

enter image description here enter image description here enter image description here