Mac App Gui executing bash script

webking

macrumors newbie
Original poster
Apr 24, 2016
1
0
Hi.

I hope someone can guide me to the right directions.

Basically I would like to create a program for mac OSx such as my_program.app and of course it has a GUI and a few buttons and display area which allow the GUI to be able to show the results of the bash script inside the GUI and not in terminal. Will Xcode work for this type of thing?

Please assist. Thank you so much.
 

superscape

macrumors 6502a
Feb 12, 2008
919
214
East Riding of Yorkshire, UK
Absolutely, Xcode will work. Although if you don't know any Objective-C or Swift then it's a steep learning curve. (You need to be looking at NSTask: https://www.raywenderlich.com/125071/nstask-tutorial-os-x )

Alternatively, if you'd be satisfied with just popping up a few user dialogs and maybe dumping the results into a text file then AppleScript might be a better option. You'll probably get going quicker. Or possibly you might use Automator - I posted a guide to using Automator to make shell scripts more user friendly a while ago: https://www.ghostotter.com/making-shell-scripts-little-user-friendly/

So, in short, yes you can use Xcode to create a GUI for a shell script but there will be a steep learning curve. You might see results faster if you have a more basic GUI and use AppleScript and/or Automator instead.

Good luck!
 
Last edited: