osx service for `mpc add`ing files to mpd’s playlist I’m trying to create a service in automator, which allows me to add files/folders from Finder directly into my mpd playing queue.

I tried the following, the command runs, but nothing happens.



Could anyone please help?

PS: My music-directory is $HOME/Music/ – if that’s important …

EDIT: The following code works perfectly in bash, but not as service.

for arg in "$@"; do
  dir=$(cd -P "$(dirname "$arg")" &amp;&amp; pwd)/ || continue
  mpc add "${dir#"$HOME/Music/"}$(basename "$arg")"
done
Following code …

for arg in "$@"; do
  dir=$(cd -P "$(dirname "$arg")" &amp;&amp; pwd)/ || continue
  /usr/local/bin/mpc add "${dir#"$HOME/Music/"}$(basename "$arg")"
done


does the trick.