I'm writing a simple service to open a file in Emacs through selection in Finder.
for f in $@ do open -a Emacs "$f" done
If a file is selected in Finder (solid blue on the file after left click), and the service is called, the script runs twice for any selected files.
If I right click on a file without selecting it (clear box after right click) and call the service, then the action is performed once.
There is no Automator service of "getting Finder items" above this script.
Why is the service being called twice if a file is selected (left click on a file) but only once if selected with a right click?