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 am trying to create an automator workflow that will do a google search for the filename of each selected file in finder.

Unfortunately the workflow I have created works just with one selected file. If I select multiple files it doesn't work.

How can I set the Shell Scrip to be executed individually for each selected file in Finder?

Screenshot of Automator Workflow

I have used a custom 'Get Names of Finder Items' Automator Action downloaded from here.

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

Use a shell script such as the following that will run the command each time for each of the arguments:

for f in "$@"
do
  open "http://www.google.com/search?q=$f"
done
share|improve this answer
1  
Thanks a lot! This works perfect! –  MG3165195 Jan 6 at 11:58
add comment

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.