Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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

2 Answers 2

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

 
discard

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.