Change name and Application icon when starting via Automator I have a script called gnus:

#!/bin/bash
open -n -a Emacs --args --name Mail --title Mail --no-desktop --no-splash --funcall gnus


which I call via Automator 

Run Shell Script - ~/bin/gnus


Now I the name next to the icon in the dock, when the program is running, is still Emacs and thew Emacs icon (as when starting Emacs.app directly.

I would like to have the gnus icon and the name as Gnus as I want to pin it to one specific Desktop.

How can I achieve this?
You could make a copy of the application bundle:

cp -r /Applications/{Emacs,gnus}.app
defaults write /Applications/gnus.app/Contents/Info.plist CFBundleExecutable gnus
defaults write /Applications/gnus.app/Contents/Info.plist CFBundleIdentifier my.gnus
echo $'#!/bin/bash\n/Applications/gnus.app/Contents/MacOS/Emacs --name Mail --title Mail --no-desktop --no-splash --funcall gnus' &gt; /Applications/gnus.app/Contents/MacOS/gnus
chmod +x /Applications/gnus.app/Contents/MacOS/gnus


I changed the bundle identifier because spaces assignments are per bundle identifier. It also makes the application have a different preferences file.

I don't know how to change the application name.