Automator shell Script works, except inside dropbox

automatorcommand linedropbox

I used Automator to create a service that runs pdf2svg from the context menu in Finder.

for f in "$@"
do
    /opt/local/bin/pdf2svg $f ${f%.*}".svg"
done

It works fine, except it does not work on files stored in my dropbox folders.

How can I fix this?

Best Answer

If any of your files or folders in Dropbox happen to have spaces, your script will not behave as you expect. You can fix that by adding quotes to the appropriate places like so:

for f in "$@"
do
    /opt/local/bin/pdf2svg "$f" "${f%.*}.svg"
done

If that isn't the source of the problem, please update your question with more specifics as to what the behavior is that you see when you run this script manually from the command line.