Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to create a service to copy the URL and subsequently download it via wget.

How would I go about creating an OSX service to wget arbitrary urls from a browser or system wide. I believe it'd be possible with Automator's Run Shell Script action.

I had it set up to use my default shell (bash) and run the command found at /opt/local/wget but for some reason I'm not getting it to pass along the url.

share|improve this question

I have done something like this before, and what made my life easiest was pbcopy and pbpaste. They allow you to either read the current clipboard or write to it.

So you go to Safari, copy some text, run an automator action. Action is run shell script schell script is just basically just wget `pbcopy`

share|improve this answer

Have you tried using it as standard input with xargs? That works for me.

xargs wget

The other way is to perhaps use $1 as in:

wget $1

I'd quote that for safety's sake too:

wget "$1"
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.