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 have a shell script that deletes exif data from images.

I would like to right-click the folder with the images and execute the command from the context menu.
How can I do this?

The Shell script is:

exiftool -all= -overwrite_original test

where test is the dir with the images

share|improve this question
up vote 4 down vote accepted

If you're using Snow Leopard, you can create a Service, and it'll show up in a submenu of the contextual menu (as well as in the Services submenu of the Finder menu). To do this:

  1. Run /Applications/
  2. Choose the Service template
  3. Set the Service Receives Selected pop-up (above the workflow column on the right) to "Files and Folders"
  4. Find the Run Shell Script action in the second column (the search field at the top can help), and drag it to the workflow column
  5. Set the action's Pass input: pop-up to "as arguments"
  6. In the template script that appears, replace echo "$f" with exiftool -all= -overwrite_original "$f" -- the script should now look like this:

    for f in "$@"
        exiftool -all= -overwrite_original "$f"
  7. Save the Service with some descriptive name

share|improve this answer
Excellent, thanks. I just wanted to add that in step #3, "Files and Folders" in "" I also skipped the loop with [exiftool -all= -overwrite_original "$@"] – FFish Nov 18 '10 at 8:04
For some reason, it didn't occur to me that exiftool might be able to take multiple files & folders. As for step 3, restricting the service to doesn't really matter -- what other app do you select files & folders in? BTW, one limitation of this is that the Run Shell Script action doesn't do a very good job of error reporting, so if anything can go wrong, the script should take care of its own reporting. – Gordon Davisson Nov 18 '10 at 17:10

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.