tags:

views:

364

answers:

4

Hi.

I know that I can pin applications to the dock and launch them from there. However, is there a way to pin a program to the dock that is not an "application" in the MacOS sense, like a bash script for example?

+2  A: 

You can drag any file to the right bar of the Dock (where the Trash and folders are), and execute it by clicking it.

To execute a shell script, you can save it as a .command file and the OS will pick it up.

Another alternative would be to create an Applescript application for your script, and use it like any application.

pgb
+1  A: 

The Script Editor can create applications based on AppleScript. Stick the following code into a script and save it as an application:

do shell script "~/someScript.sh"

Where ~/someScript.sh is the path to your shell script.

Samir Talwar
+1  A: 

Rename it to something.command, and in its Get Info window, select Open With > Terminal.app. Then when you double-click it, it will launch the Terminal and run the script. You can drag that to the dock.

JW
+2  A: 

There are also tools to make applications from shell scripts, perl, python etc. There's DropScript and Platypus that I know of. They have the advantage that you can drag and drop files onto them.

AmbroseChapel
Platypus is cool
Wahnfrieden