Automator: action/service on right click on an url

automator

I keep doing the same thing over and over:

  1. Copy a url
  2. Run a script with the url as a parameter

php myscript.php –url "URL"

I'm pretty sure Automator can help here, but I'm completely stuck to understand how. My idea was to create a service: right click on the url > service > myscript.

How can I do that, or is there another solution out there?


Edit:

Here is what I tried, create a service with an URL as input.
worflow creation
Unfortunately, the service does not even show up when I right click.

enter image description here

Best Answer

Seems like "Service receives selected URLs" only works with Internet actions. Fortunately you can use the "Get Specified URLs" Internet action to relay the service input to your "Run Shell Script" action.

For example, I used the following automator service to open a selected link in a non-default browser. In my case Firefox but you can use Chrome or another browser.

Automator service using URL input

Remove any address from the "Get Specified URLs" action so that the list is blank as in the screenshot above. Don't forget to "Pass input: as arguments" In the "Run Shell Script" action if you're using the "$@" notation.