How to make a command line executable an application

applicationscommand lineterminal

I have a command line executable (specifically JMeter), which opens a GUI application when launched from the terminal. However, I would like to create a link to it that would wrap it up to become a proper Mac application (included in /Applications directory and all that). How do I do that?

Best Answer

Use Automator.

  1. Open Automator and double-click on Application.
  2. In the "Name" search box, type Apple and you should see "Run AppleScript".
  3. Drag "Run AppleScript" into the right-hand window.
  4. Where it says (* Your script goes here *), replace that text with the following code:

    tell application "Terminal"
        activate
        do script with command "JMeter"
    end tell
    
  5. File > Save and enter a name, and choose where to save the application.
  6. Double-click on the newly created application.