MacOS Terminal – Adding a Custom Launcher in Dock in Mavericks

automatormacosterminal

I am new to Mac OS (I am currently using Mavericks) and I have performed google searches as well as search on StackExchange regarding my question but the discussions I came across don't quite answer my question.

I come from the linux world and it is trivial for me to set a custom command in the gnome-panel and then put in any argument I like; many of these commands invoke xterm.

So for example, suppose I want to create a launcher to connect to a remote server with lot of arguments as below.

xterm -fg orange -bg black -e ssh me@myserver

I cam across a post that suggested I use the automator.
I am however unable to do this successfully.

So far in the automator, I have

open -a "/opt/X11/bin/xterm" --args "-fg orange -bg black -e ssh me@myserver"

however this command does not execute properly and I am not sure how to solve this problem.

Thanks
Les
p.s. Note that if I launch the Terminal and type in xterm, it launches as expected

Best Answer

You can write it as a shell script within the Run Shell Script action in Automator:

Automator

Save it with the type Application (instead of Workflow) and place it in your Applications folder. It can now be placed in the Dock.