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?
In the Script Editor app on your Mac, click the Run button in the toolbar, or press Command-R, to execute the commands in your script.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With