MacOS – your preferred way to start a (shell) script from the GUI

command linemacosscriptterminalui

I was wondering what ways there are to start a (shell) script from the GUI, e.g. double-clicking an icon in Finder or launching via Spotlight.

This is not about opening a terminal and "manually" launching the script.

I used to have .term files on the desktop, which launch a terminal session and can also be extended to execute a script upon launch. This is nice if you need interaction or want to monitor the output.

I also know about running a shell script from Applescript, and just read about the .command files.

What is your preferred way to start a (shell) script from the GUI, and why ?

And maybe you could also write if it shows output and allows interaction or is just an invisible wrapper to e.g. start a program with its own GUI.

Best Answer

You can use an app like Platypus.

Platypus is a developer tool for creating application wrappers around scripts. In other words, it creates Mac OS X applications that execute a script which is bundled within the application. Command line scripts can thus be run transparently from the graphical window environment, integrating seamlessly with the user interface.